When I first came to Islam, I asked my teacher if I had to give up my dogs. He asked me, what is your reason for having dogs? I told him that I kept them not only for protection, but to also save them, as they are quite elderly and would have been put to sleep had they remained at the shelter. He said that my reasons for owning dogs were good reasons in the sight of Allah - we are allowed guard dogs, and we should protect all innocent things - and that there was no harm in my keeping my dogs. Because of where I live, where it gets to -30 in the winters, my dogs stay in the house as no kennel would be sufficient for them. But my teacher did tell me to always wash what a dog's tongue has touched, and be especially observant in wudu.
My cat makes much of a worse mess than my dogs do, tracking cat litter everywhere and having absolutely NO respect for prayer or study time.