Most chat-capable AI's are based on simple word vector approaches that determine what to say based on what occurs frequently in their training data.
The red doctrine has powerful memes that rooted deeply in the conversation of its members, so the AI treats it as useful data to base conversation on. This is accelerated if groups as /pol/ dis-proportionally interact with the AI's training, such as with Tay. Whether this leads to a more general rule is an unproven hypothesis as far as I'm aware. (this does not bother the red doctrine, they are more than happy to generalize from one or two examples)
As for why they get shut down, I guess the weak fear the strong.