SOCIAL STATUS AND SANITATION:
Long hair comes with a requirement for intense care and management, something that requires, time, funds and hygienic conditions. Since only the rich were granted all three of these things, long locks, inevitably and especially, in women, (who were anyway relegated to the houses as they were not allowed to work), became a marker of their social status. Only the poor women had to go to work, live in unhygienic conditions where it was impossible to maintain long hair, and they never had the money and resources to maintain long tresses.
Hence, long hair was a luxury only the rich, and the high-caste, women could afford to have. Similarly, under many dynastic rules, the slaves and criminals were marked with shaved heads, a consistent reminder of their low or fallen social status.