It does not contradict the Qur’an. If you read 56:22-23, it says “And Hour al Ein. This is the reward for what you did.” So it’s saying that God will give the people of heaven Houris. The last person to enter heaven is still a good person who was forgiven by God. He’s just the last to enter. The hadith is not saying every person will enter heaven. It’s just saying that the last person to enter will have two houris.