Imagine you are going to a car shop to buy a station wagon only because that's the best car you know and then your wise relative comes to you and shows you ferraris and lamborghinis, saying that if you give up the station wagon and follow his advice, you will soon be able to afford these much superior cars, what would you do? You would take his advice, especially if you trust him and have the ultimate respect for him.
That worked for venerable Nanda. It may not work for everyone. But then the Buddha knows what a person needs to hear to get him inclined towards the practice. The Buddha redirected his craving towards a woman by altering his goal to something superior to get him to follow the path that actually eliminates craving. Even parents do this with their kids. They promise to buy a gift the kid likes very much if he passes the exam well. So the kid studies hard to get the gift and as a result passes the exam.