SO content is user generated. It is a bit rich for them to put a wall around it and claim that it is chargeable for use as an AI training set by other companies (unless they also have a plan to share the income with their users).
Especially so given their stance on cash bounties for answers/sponsored questions etc.,
The mods on SO and StackExchange family of sites frown upon cash bounties for answers. But when SO itself wants to erect a paywall around the Question-Answer set for AI training, it is somehow clean and moral.