The term originated back in the theatre, where the cheapest seats were those way at the bottom
floor and where
people purchased peanuts because they were the cheapest snack. If they disapproved of the performance, they would throw the peanuts.
Howdy Doody, a show that started in the 1940's (not 50's), the
children in the crowd were considered the "Peanut Gallery."
Vaudeville era
man: Ay! This show sucks! You all
suck! get off the stage! *Throws peanuts
Announcer: No more comments from the peanut gallery!!!!!!
Vaudeville era woman: Throw more nuts chap!!!!
Vaudeville era
man: I'll give you some of my nuts instead..