Well, it's because there are in fact mushrooms in the real world that will give you superpowers. Or rather, they'll make you think you have them, right up until the cops wrestle you to the ground.
What Inspired It:
According to Mario creator Shigeru Miyamoto himself, it came from one hell of a predicament. In early runs, the developers found that Mario was too large, so in order to make Mario grow and shrink throughout the game they decided to add "magic mushrooms" for him to snack on like the titular character in Alice in Wonderland.
Why would anyone--from Lewis Carroll to Nintendo--associate mushrooms with getting smaller or bigger? It's because of hallucinogenic toadstools like Amanita Muscaria, as folks who have ingested them know, screw with your perception of size.
Of course, Nintendo was probably just basing their mushrooms off of the idea forwarded by Carrol. It's not like they designed the ones in the game to look exactly like the psychotropic that would make a plumber think he was shrinking and turning into a giant in the real world.