From the Super Mario Wiki, the Mario encyclopedia
The Spinning-Door is an uncommon door appearing in Paper Mario: Color Splash. It is made up of three vertically aligned panels colored red, blue and yellow, with a large diamond in the middle. It is first seen in Daffodil Peak.
When hit with Mario's hammer, the panels will begin to rotate. Mario can then hit the Spinning-Door three more times to stop each panel; if he matches all three of the same color, the door will be unlocked. If Mario hits a panel that doesn't match with the previous one(s), he will lose one coin, but the panel(s) will keep spinning. Each Spinning-Door leads to a different minigame depending on the color of the door. The minigame rewards include coins, Battle Cards, and hearts. After clearing or failing the minigame, the door cannot be accessible again until Mario collects another Mini Paint Star.
If Mario activates a Spinning-Door he's already opened before, the rotating panels will also show parts of a rainbow door with a question mark on it. If he matches these three panels, he can access a fourth minigame.
The music that plays throughout each minigame is an arrangement of the overworld theme from Super Mario Bros. 2.