20K seems like a huge amount when you are eating ramen noodles and wondering how you are going to get your car past its next inspecton. The seeming largesse is tempting, but to the Navy, it represents maybe two months' difference in your pay between what they will pay you and what you would make otherwise as a trained specialist as a civilian. So they offer it.
The quality, and just as importantly, the availability of residency training should matter a lot to any medical student. The unfortunate thing is that it seems like an issue much farther down the road than the impending meeting with the bursar's office to settle your tuition and fees. That is a distortion in perception that the Navy exploits, by happy opportunity if not deliberately. While it is true that the Navy has some very good residency program opportunities to train, they are not always very plentiful, and their calculus has been to count on a large proportion of the students they accept through the HPSP to leave before doing residency. Competitive programs will typically require at least one service tour as a GMO between internship year and PGY2, and many GMOs correctly come to perceive their chances of getting good training as better outside the service as a civilian than inside the service. So those GMOs typically apply for civilian programs and when they are selected, they stop participating in the military match as GMOs, a phenomenon that results in a higher "acceptance rate" to military residencies than might otherwise be the case were training opportunities more realistically available. To give you a sense of the proportions, a PGY1 surgery intern class might have sixteen members at one of the big three training hospitals (not counting IM, transitional, peds, OB or psych interns.) On the PGY2 intake, there might be two general surgery residents, one or two ENT, one or two ortho, one Urology resident . . . and that's it. Navy-wide, there might be one neurosurgery resident per year and maybe four or five ophtho residents (only two centers have residencies, and one is shared with the Army.) You can see that a system like this cannot accommodate the training needs of the interns it takes in. And when you figure that USUHS graduates are at least considered more likely to have longer careers,and may be more likely to have prior service, their relative competitiveness compared to HPSP graduates with shorter obligations works against the HPSP applicant in the nebulous but credit-worthy assessment of "career potential."
I would not tell you to not serve if that is what you want, but you should know that there is more to your decision at stake than service owed for money paid. There are opportunities you will likely forfeit in exchange for your service commitment, and those things forfeited are not inconsequential. Four years may seem like a short time when you are 21, but its significance will likely change for you as you get toward the end of medical school, when finishing training and anticipating some stability in your life and other things (like income) matter much more than you think they might when you are walking into the bursar's office to turn over your loan check.