Hagar was a surrogate mother, not a wife. The technology wasn't at today's level.
She was essentially a concubine but the Bible refers to her as a wife in keeping with the standards of the time, and translation…
“Sarai his wife took her Egyptian slave Hagar and gave her to her husband to be his wife.” (Genesis 16:3)