I feel as if those “non-mandatory” company “social” events are actual “mandatory pseudo-social events” and should be treated as what they are: a test to see if you perform well in a different context. Is it fair, ethical, honest, or enjoyable? Not even a little tiny bit! Is it racist, sexist, annoying and uncompensated work? Absolutely, yes.
But…it’s a sort of test for employees who’d like to have a rich life outside the office/have a side hustle, etc., and simultaneously a litmus test that applies to them as employers. Perhaps it’s wise to ask about “after work social events” while interviewing, or read company reviews on Glassdoor so these horrible workplaces can be avoided if that’s a bad fit for you?
I’ve often had bosses who don’t feel successful until each direct report seems to be indoctrinated into the company cult — I.e., “true believers”. People with meaningful priorities elsewhere don’t just go along with stupid or unethical bullshit. They are the ones that ask uncomfortable questions.