From what I recall, people have done calculations on these forums that show civilian physicians coming out ahead of their military peers in the long run.
As I noted in
@HomeSkool's awesome thread, this is specialty and time dependent. If you match to a high-paying specialty, at the end of your commitment, you will not be appreciably behind your civilian colleagues, as they will have lots of debt that you will not have. Additionally, your residency salary will be significantly higher, and you won't have to pay for health insurance, malpractice, etc. If you go to USUHS, you will actually be even closer, as you will be getting paid even more while in medical school (average for civilian accessions is $65k/year, I believe, while for HPSP it's like $20k or something). If you are in a high-paying specialty and stay past your first commitment, you will see your civilian colleagues pull away from you. At retirement, you will have a good deal though, as you'll be getting a pension and then later your TSP.
If you are in a primary care specialty, you will do better than many of your civilian colleagues (or at least as good), and if you stay in, your pay will continue to increase until you retire, at which point you get that pension. Your civilian colleagues will have to really hustle, while you'll get annual COL raises and regular increases in pay that are no joke. And again, you don't have to pay malpractice or health insurance.
So the answer is that it depends. If you go into something like orthopaedics and stay past your commitment, you will not be making nearly as much as your civilian colleagues. Your retirement might be easier, but they will be making much more in the interim and will probably have a decent retirement. If you're in primary care, though, it's harder to say which is better, since the salary gap is very small or non-existent.
ETA: But your other question is better. Why take the HPSP? I really don't recommend anyone taking it whose primary intention is something other than serving. If you're doing it for the free tuition and think you can just suck it up for a few years to pay back your commitment, you'll probably have a miserable time. But some people actually really enjoy the military (myself included), and that's because service itself is a major motivator.