Collect all 120 Power Stars, which opens the endless staircase at the top of the castle.
Climb it and you'll reach Bowser in the sky. Grab him by the tail, swing him around, and release toward one of the surrounding bombs — the explosion does the real damage.
Three throws and the game is finished.