Stadia isn't being shut down because it wasn't successful; it was no less successful than other services that are still up (like GeForce Now, or, for that matter, PS Now.)
Instead, it is my understanding that the point of Stadia was to give Google Cloud GPU instances a first-party "spot workload" to run when otherwise underutilized, since Google were building that instance type out ahead of confirmed business demand. They had all these idle GPUs just sitting around; may as well let people play games on them!
The moment the first GPU-backed generative AI models were open-sourced, though, there was suddenly tons of business demand for cloud GPU instances, to back all the "this[whatever]doesnotexist"-type services that were popping up. And "actually renting the GPU time to people with a business use-case for it" is much higher-margin than letting people play games with them. (That was the original intent of building out the instance class, after all.)
Stadia accomplished its purpose. The demand for the instances arrived, so Google didn't need Stadia any more.