Translation:We always used to have the dogs in the house.
Both are correct. You use the "a" when you personify "the dogs". In Spanish, you must put an "a" before the object of the verb (the noun the verb is acting on) if it is a person. So, you say "Yo veo a Luis" (I see Luis), and "Yo veo la silla" (I see the chair). In the case of animals, you sometimes can treat them as people and you use the "a".
It's a common misperception that the animal has to be a pet. Actually, the accusative ‘a’ is used in Spanish whenever a definite direct object is animate. Animacy is a hierarchical concept, so the ‘a’ is omitted more often for objects further down the hierarchy, but the prepositional-accusative ‘a’ is so pervasive that it is sometimes even used for inanimate definite direct objects.
Generally the personal 'a' is not used after tener. According to the link below, it can be used when it signifies to physically hold someone or to have someone somewhere.
This exercise would fit into the latter category but illustrates that someone is too restrictive. The exercise suggests that this exception to an exception applies to any DO which would normally take the personal 'a'.
Maybe they went outside at night but were in and out during the day. That way, we used to have the dogs in the house but they were kept outside?
If you are saying about "teníamos" possibly meaning "used to keep" then I would say that (as far as I understand) it just doesn't mean that, I think you would use the verb "quedar" for that - I think it would be something like "Siempre se quedábamos los perros en la casa" but I am sure that this is not quite right, hopefully someone with a better grasp of Spanish can shed some light on this.
In contrast to English Spanish has TWO Past tense forms, Past imperfect (in this sentence "teníamos..") and Preterite "which would be "tuvimos..." for this sentence); since the two Spanish Past tense forms are used in different situations, Duolingo (and other Spanish learning websites for that matter) use "used to have" for "teníamos" and "had" for "tuvimos" to help learners to distinguish the two forms and by making learners use two different English forms as well. Hope that helps
It is still marking a correct English sentence wrong. In another example, the translation for "Ese día teníamos más dinero" (or something like) is given as "That day we used to have more money". This is awkward at best. "Used to" is redundant in a sentence that refers to time (e.g. using 'always', 'in those days', 'when we were young', 'often', etc.). I would be less irked if the sentence did not use "siempre". However, I do see your point. I will just have to try to be consciously aware of the Spanish tense rather than just jumping into the English translation, which is probably a good habit to get into anyway. Thank you for your reply