This is a complicated problem with very little the airlines can do without pissing off the customers. When there is inclimate weather that has a chance to go away, the FAA may issue a stoppage which will prevent planes from taking off. If the weather was really bad, the flight would have been cancelled outright. However, in these situations, the weather is just passing through. Now comes the tricky part, once the weather clears, the plane can leave but has to get squeezed into an existing schedule of planes waiting to take off and planes that may have been holding to land. The pilot may receive a clearance that is only good for 15 minutes. It is impossible to load a plane full of passengers in fifteen minutes.
Leaving the gate and waiting is beneficial to the airlines because it frees up a gate that needs to be used for passengers that just landed as well keeping the plane ready for an immediate departure when clearance is given. If the airlines went back to the gate and allowed passengers to disembark, this would create lengthy delays as well as possible create a huge safety issue if passengers decide not to return to the plane. Any passenger that doesn't return would have to have his/her bags off loaded. Also, pilots put in alot of work calculating weight, balance, fuel, and power needed for the flight. If these numbers change, it could put the airplane in danger.
I am not saying I agree with waiting on the tarmac for 8 friggin hours. I would say that if 90 minutes go by the flight should be outright cancelled.
The pilots and the flight attendants do not like when this happens at all. Did you know that most pilots and flight attendants only get paid for flight time? That means that the entire time the plane is on the ground they are not making any money.