Do it if you have a sincere desire to join the military. If you don't start from a sincere place, you'll join the legion of miserable MFs who joined for money and sincerely regretted it. Check out the MilMed forum on here for proof, half the people on there got out 20 years ago and are still whining about their experience on a forum.
You're guaranteed to match into something, at the very least an intern year for full medical license, through the military match. You're usually required to apply to at least 2 specialties which could include TYs / prelims if you're deadset on something. You are allowed to reapply again usually in residency or after 1-2 years as a GMO. It is possible to occasionally do residency in a civ program. Specifics depend on your branch.
You should plan to deploy at least once in your payback period. Do not join the military if you don't want to deploy. Deployments are usually about a year including train-up and the return process from what I understand.
Many people in the military have families. It is possible but they need to be aware that there will be sacrifice. You can be pulled away with a moments notice if war happens. You will have to do random trainings or field exercises at times. You will almost certainly be making less money than a civ attending during your payback.
Talk to a recruiter and ask them for GME info and to talk to a military medical officer, they usually have a contact they can give to prospective applicants. I'm a fresh HPSP M1 so take this all with a grain of salt.