Yes the raw compute cost is much higher (and the performance often less) than bare metal, but software development is really, really expensive. With the public cloud you get the result of literally millions of programmer-hours "for free". To many that's worth it (at least at first, below a certain scale).
This is also one reason why Kubernetes is really exciting, BTW. It's a control plane that you don't have to rent.