It doesn't make sense if you are not rich.
Completing a PhD typically takes 5-7 years in the US. In my public university, the nominal tuition for that time would be $100-150k for in-state students and $180-250k for others. Then add living costs on top of that. A PhD increases expected lifetime earnings over bachelor's, but not in all fields and definitely not enough to justify such spending.