I beat him in a battle just asking and he just gave me the master ball straight away! this was not expected!
Take this with you! This Master Ball can catch any kind of Pokémon! Ghetsis was saving it, but you'll probably put it to better use!
That was what he said.So thats why he gave it you.Probably he didnt like ghetsis and thats why he gave it to you.Maybe gamfreak wanted it this way because you could catch legendaries.