Can think of a few reasons... I'll leave you to comment on their validity...
Depending on the seat layout, you can end up with nothing to hold onto - so everyone tries to stand by the doors where there are poles.
If you end up standing in the middle of the carriage, it can take forever to get off when you arrive at the terminus which means you end up queuing to get through the barriers. If you're in a hurry, standing near the doors means you get off again quicker.
Some people might be getting off at an intermediate station so want to stay near the doors rather than fighting their way through.
People are idiots.