I find it a bit hard to believe that a whole microcontroller can be cheaper than a few electronic components on their own. Probably what did happen before the shortage was that the MCU was cheap enough and gave you a great flexibility in prototyping and coudl be suited for many different tasks. After the prototyping stage, it should've been replaced by simpler things, but since good enough was cheap enough, it was left as it was.