Do Stack Exchange's terms and conditions allow people to publish books from Stack Exchange content?
I found a bunch of such books on Amazon by the same "author." For example, this one with content from the Writers group.
Repackaging content from Stack Exchange sites is legal so long as you follow the requirements in the CC-BY-SA license. This specific series of books has been brought up on Meta.SE, and even before that, the company was aware of them and had no objections.
I've helped Mi Yodeya produce four cultivated collections of our material so far. I talked about that a little on Meta.SE. SE supported our efforts, including allowing us to use elements of the site design. (Note that the site design is not part of the CC-BY-SA license; you have to ask for permission for that.)