Because of a technicality, Duolingo being a computer program it sees the solitary "a" as being an article and not a preposition so it believes that we used the feminine for the masculine.
That's one reason why it is best to just always include the article for possessives (not needing to guess, and also that it is less optional for Portuguese outside of Brazil are a couple others)..
Yes, you are correct. "Marido" means husband and "esposa" means wife.
It is common in Brazil also to use "mulher" meaning wife. "Ela é minha mulher" / She is my wife. But bear in mind that his is informal and some people do not like to use "mulher" in the sense of wife.
I would advice you to use "marido" and "esposa" for husband and wife.
Marido is husband. Unlike so many Portuguese words there is no marida in this case to mean wife. However, esposo/esposa mean husband/wife and the wife-only word to counter marido is mulher, the same word as for woman, but with a possessive attached such as, a minha mulher or a mulher dele.