Dali frequently painted ants in his images/works - if you look at more than one of them you will see it is a recurring theme in MANY of his works. The anteater is really kind of a joke on himself, not just a way of getting attention. The photo above is just another image he created.
Yes it really was his pet. He really did have an anteater. He wanted one because it was something no one ever saw (EVER), and he was sure it would turn heads when he took it for a walk. As you can see, it did.