I never thought of it that way, but that is sadly true. Why give a cheat code for XYZ when you can charge $1 for every time someone uses that cheat?
I imagine it is partly due to debugging being easier now too, there will be tools that render cheat codes inept.
But I think it is mostly the money. Look at what is happening to various modding communities now. People will make shit for your game for free and extend shelf life by a number of years, yet some devs have stopped mods being created and released shitty DLC instead. Steam actually had the balls to try and support it again after the original backlash the first time they did it.
Valve would have been next to nothing without the modding community. It infuriates me to no end when devs stop mods in their tracks. I can't remember how many HL1 or Q3 CD keys I bought back in the day, all because of mods.
DLC and microtransactions replaced cheat codes.