As recently as 15 years ago, using "they" to refer to a single individual was derided by many as grammatically incorrect. It was common in colloquial speech, but frowned upon in writing, mostly because it increased ambiguity. The thinking was that if you accept "they" as a third person singular pronoun, then sentences like the following would become unclear: "Sally and her friends went to the mall, then they left".
Of course, this is correct: singular "they" is ambiguous, and often frustrating. But it's what we've ended up with. The recent acceptance comes down to two factors: linguistic descriptivism finally overshadowed linguistic prescriptivism, and non-binary gender identity (and concern about accidental misgendering) became more prominent.
[0]: https://en.wikipedia.org/wiki/Gender_neutrality_in_languages...
(^ Note the "Spivak pronoun". Courtesy of the same Michael Spivak who wrote Calculus on Manifolds.)