Those who were meant to die, die and the story keeps on. schahzaman Killed his wife and that black man she was sleeping with, but his life continue and both the kings schahriar and schahzaman on their journey finds a beautiful women and she ask her to do things that are not allowed in Islam.
But if they are not going to do, they will be killed, they got affraid and did what she asked and satisfied her. they don't wanted be killed like this, after all there were king and was ruling the countries/tribes.
But still both had something going in their mind about their wifes, they may have never thought that their wives could be unfaitful to them. No man can think of that and also can't bear that.
that is why King schahriar upon reaching to his palace, killed all the people including his wife who were involved in this shamful act, I think he should have done it long before when he saw everything with his Eye. Don't know the reason why he hadn't done that before.
As a result of this event, he started hating all the women in this world and that is why he started to have s*x with girl in the tribe and killed her to satisfy his hate for the women hood. But i think he did wrong. Not all fingers are equal. As he is a king and no one can stand infront of him. Only two girls were remaining in the tribe, who were vazier daughters. Shehzaade i think is the one who is writing this stories and she will teach the king schahriar a lesson for what he had done with all the girls of tribe.