Because these mandates coincided with a recession and the worst tech job market in a couple decades, and saying no meant you'd potentially be unemployed for a very long time.
Yes, it would require a lot more coordinated organizing and some level of pain, though I think the payoff would be worth it.
"coincided" is understating it; it is precisely the bad job market that leads to this sort of mandate, because employees have little choice but to go along. in a good job market companies are very willing to offer remote work as an incentive to join them rather than the competition.