Mostly it was that electronics got cheap enough that you didn't need to keep building the bulky and expensive mechanical version. The first wireless remotes that used batteries were still ultrasonic, they just generated the tone electronically instead of by striking a metal bar. Plus, you could have way more buttons with an electric version; you would need a bar per function for the mechanical way.