> Requiring a company to write recommendation letters would be compelling speech
It would, but that's not what's being discussed.
The accusation is that the companies are restricting speech by saying that managers cannot provide a reference, even if they clearly state in said reference that the views are their own and not that of their employer. Nobody is trying to compel anyone else to provide a reference, the idea is that nobody should be prohibited from it, especially since for long term employees leaving on good terms their manager(s) is/are probably one of their best references.