"and you grant Stack Overflow the perpetual and irrevocable right and license to access, use, process, copy, distribute, export, display and to commercially exploit such Subscriber Content, even if such Subscriber Content has been contributed and subsequently removed by you"
https://stackoverflow.com/legal/terms-of-service/public
This content isn't licensed under CC-BY-SA to stackoverflow, it carries additional riders which grant SO the legal right to sell it however they please.