Real estate and stock investing is not a career. It is strategy to secure passive income and reduce tax for retirement .
When you have your own practice, you can put away $50K+ annually into your IRA and reduce tax against it. That IRA money will lose value due to inflation if just left to sit there; so you invest it in the stock market to grow tax-free until retirement. When you retire, you'll probably be in a lower tax bracket so you're taxed less (say 20%) when you withdraw than when you contribute into it (say 38%). So you deduct more tax at peak working income putting money into IRA but then pay less tax from that same IRA at lower income retirement.
If you have extra cash under your mattress cause you have no more school/practice/spouse/kid/etc. debt, then you can buy income properties or invest it in the stock market. You can depreciate the real estate to reduce tax on your rental income. Rental income also don't pay social security tax and medicare tax (in most cases) cause they're passive income.