Are you suggesting it is morally wrong to earn a profit if it would better serve the public good? How and more importantly who defines public good? A major theme from The Wealth of Nations refutes your point by arguing that the greatest economic benefit occurs when people act in their own self-interest:
> It is not from the benevolence of the butcher, the brewer, or the baker that we expect our dinner, but from their regard to their own interest.
It sounds like you're arguing for a socialism model where a central authority decides how to use capital.