One could argue that those writing the letter should have known it would be leaked. But you could also say that about any kind of internal criticism. I'd counter that this argument has the 2nd-order effect of preventing any kind of internal criticism, constructive or otherwise, lest it be leaked at some point in the future.
Not to mention, the "demoralizing" label could also be applied to Musk's public behavior, which is the bulk of the point that the letter and its authors are making.
I assume they tried making it an internal matter before going public. Pushing your employees to have the feeling they need to go public instead of being able to solve this internally is a failure of the company.
"This should have been kept internal, where we could have fired you without publicity"
The most powerful response is to have a top level stakeholder meeting, identify changes from the letter which need to be made, then: fire everyone who wrote the letter, and make those changes.
This sends the message that management is responsive to worker complaints, and will also send you packing immediately if you defect on the company by making anything public which should be an internal matter.
If they do only one of these things, it's either demoralizing or mutiny. Neither of those outcomes is good, one is completely unacceptable. So this is what happens.