Companies exist for only one reason - to make money. If a pharmaceutical company decides that the production of a specific vaccine will be a profitable venture, then it will work on creating that vaccine. Other than that, they are under no legal obligation to produce any specific product.
Ethically, it would be nice for these companies to reinvest some of their profits in research that would benefit the needy. US companies can get a discount on their federal income taxes for doing work of this nature, and some companies have also used charitable research as a way to improve the company's public image.
Keep in mind that in some cases the availability of the vaccine would only be half of the solution; getting it distributed to those in need can also be costly, and would not be the pharmaceutical company's responsibility.