Most doctors and lawyers don't make lots of money in comparison to a reasonably well paid software engineer. There are tracks that will lead to bigger bucks (if lucky) where you essentially sell your soul for the chance to get there. Big law firms have "partner track", doctors and lawyers can start their own practice, and various areas in medicine can still be very lucrative (eg, plastic surgery). Those tracks are all super hard. The equivalent for software engineers is starting a company or seeking a high level position at a large, fast-growing company.
I agree that software as it exists today will change: more people will come into it, wages will go down in many areas. Smart people that want to make more money will specialize (hopefully choosing the right specialization).
As a comparison though, an independent consultant with a reasonably sought after technical specialty can make significantly more money, with less school and regulation, than lawyers or doctors at similar levels. If you start a successful software business (even a tiny ISV with real customers), you can make considerably more than doctors or lawyers, again with less school and regulation. I'm sticking with software!