If a gay couple can still access the same legal rights under a civil union then the law isn't discriminatory. They have still been granted the same legal rights, it would just be under a different name.
At its core, marriage is a social institution designed to facilitate the care of children who are born of a sexual relationship between a man and a woman and to encourage both to be committed to the children and to each other. If the purpose of marriage is to facilitate childcare, and same-sex couples cannot have children together, then the purpose of marriage is defunct for same-sex couples. If marriage is an institution with a certain purpose rather than a human right, then it cannot be discriminatory to not allow same-sex marriage.