From the Super Mario Wiki
The game's purpose is to tilt the moon to make the devil fall. If done so, the player wins the game. However, if the boy and/or the girl fall, the player loses the game.
A minimum of 15 points must be earned to clear this microgame.