Your argument rests on the assumption that capitalism is the best or only economic system.
It is not profitable to feed poor children. And we don't. 25% of children are food insecure in the US, one of the wealthiest countries not just in the modern day but the history of this planet.
It is not profitable to vaccinate the poor. And we didn't. COVAX still hasn't hit their original goal of vaccinating 20% of the world's poorest. Unfortunate that poor people get sick too and spread it without regard for class lines.
Capitalism is subsidized by human capital. Whether that human capital are literal chattel slaves or Honduran strawberry pickers coming to California after the US destabilized their countries.
And capitalism requires markets too, obviously. Have to unload that cheap shit. How do you do that? Gunboat diplomacy. Open up Japan, open up China, close the entirety of Latin America to any other industrial power, and profit. Maybe sit on the sidelines of a "great war" and then after the fact you can sell stuff to the survivors.
In the 21st century we reached the end of scarcity. For nation-states. Not for people. They're still disposable, just ask who is willing to sell their grandparents to save "the economy"