Usually in Egypt it was a tradition for the Pharaoh to marry a royal women. I bet you didn't know that only the women of Egypt carried the royal blood in the family the men didn't. If a man wanted to be Pharaoh that man had to marry a women that had royal blood. Usually it was one of there sisters. Now in the modern days you can't marry blood related family but that's not how it was back then. Hatshepsut's husband died which left her to take the throne.