From the Super Mario Wiki
Mario can find the Lighthouse Keeper colorless at the top of the lighthouse. When Mario paints him, he becomes depressed due to the light in the lighthouse being missing. Huey tells the Lighthouse Keeper that he and Mario can help fix the light. The Lighthouse Keeper tries to help Mario in turn by teaching him about the parallel world, but Huey tells him that they already know about the parallel world. He then leaves the lighthouse and tells Mario to meet him at the entrance of the parallel world.
When Mario meets up with the Lighthouse Keeper, he tells the Toads that guard the parallel world to let Mario pass through. The Lighthouse Keeper thanks Mario again and wishes him luck, and then returns to the lighthouse, where he waits until Mario finds the Lightbulb.
When Mario brings the Lightbulb to the lighthouse, the Lighthouse Keeper becomes happy again and begins dancing.