There's a ton of good information in the finance forums. In general, buying a place is not a good investment for short term. Usually it's 5 years to even break even, and that's assuming that you are selling the place right away.
Besides mortgage payments, there's closing costs, monthly insurance if you put less than 20% down (may be different with physician loan, but the interest rate will still be higher without money down), taxes, utilities (your rental usually includes water and sewage and may include others - you're on the hook for all this as an owner), any upkeep necessary (your rental will cover if anything breaks and general maintenance - need a plumber, new roof, etc is on you), associated costs for selling, some cities also charge a sales tax on one or both ends, homeowners insurance (more expensive than renters). All those other expenses aren't "money in your pocket." If you move for fellowship or a job, you need to sell the place right away, which is not exactly easy unless the market goes up dramatically. You could either sell it for much less than you want or have to pay a mortgage for a house you aren't living in.
Really it's not a good investment for residency unless you can put some money down and have a long residency (6 or more years). Also, with the hours that you'd be working in those residencies, you won't have the time to put into the basic upkeep unless you have a spouse with better hours. Pay the rent, let others worry about the expenses, and be able to move as soon as residency ends. Don't buy until you have a real job.