Doing a PhD may not make sense purely from a financial perspective, but few things in life do. You don't buy a bigger home or have hobbies to make more money either. A PhD is one of those things you don't do for money, but because you find some inherent value in it.
We must not run the same circles. The number of people I know who abandoned a post doc (they were fucking miserable) is probably triple the number of people I know who got a PhD.
If your statement were true I can’t fathom why people would drop out.
You can tell when people are in it for the money because they keep doing it even when it makes them miserable.
Many people drop out once they realize that doing a PhD is not for them. I've seen estimates that the average dropout rates are something like 40-50%. Many of them are high achievers, who are very good at completing well-defined tasks given to them, but who don't enjoy working on more open-ended problems. Others are driven out by the intense pressure and the expectations of long working hours that are present in some labs, particularly in elite universities. And some, in countries where people doing PhD are considered students rather than junior professionals, cannot tolerate the poverty imposed on them.