Companies are made of people. Companies only use people if the people who make up the companies are ok with it. Being a decisionmaker in a company doesn't give you carte blanche to behave like an amoral automaton.
So no, MongoDB are assholes for doing this. They could have had some humanity and prioritized human well-being over cost savings.