A lot of reasons. First of all, it's not really their goal to make a good OS for users. They know that 95% will use windows no matter what, especially businesses, because they still more or less have a monopoly, especially in the desktop market.
In other words, any ressources spent on improving the desktop OS experience past the bare minimum is excess because they don't really get anything concrete in return.
Yes, windows is less efficient than other os, but until recently, this wasn't a problem for microsoft since you can just throw more/better hardware at the issue, which is a win win. They have to spend less ressources at optimizing code for better performance and, I imagine, they get a better cut since their hardware partners sell more devices because hardware gets obsoete every couple of years.
And in the server environment, they want it to be increasingly expensive because windows server is mostly used in cases where there is no alternative, and they want it all in their cloud.
Also, a lot of what is annoying about windows is per design. Ads, sponsorship ads, forced accounts, etc.
But the issue is that in practise, there is no viable way to verify wether or not AI has been used at all. In other words, the disclosure of AI use entirely depends on the person providing the code, wether disclosure is mandated or not.
If there was enforcment to disclose AI use, it would create a false assumption that code which claims no AI use, is verified to contain mo AI use, which again, cannot be verified by anyone.
So it's not that it's hard to enforce, it's not that it's impossible to enforce 100%, it's that there currently is no viable way to enforce it at all.