It's a matter of convenience, and of tradition.
On the earliest amps, all the performer had for output control were volume and tone. The only difference between these controls and the ones on a Telecaster was that the amplifier had a gain stage prior to these controls to boost the signal before any cutting of volume or high end was done. It wasn't until later that the RLC band-pass circuit was discovered, as well as various techniques for employing it that economized on power (for instance, using the filters to induce phase cancellation rather than shunting signal to ground).
Guitarists, who at that time were basically playing modified acoustic guitars with magnetic coil pickups placed strategically in the top (leading to what would become the semi-hollow body style such as on Gibson's iconic L and ES models), complained that this setup was inconvenient; if they needed to make a change to their tone, or simply to silence their instrument (feedback was a serious issue before the development of the solidbody guitar in the late 30s), they had to go over to their amp, kneel down, make the tweak, then play the next song, checking to see if the change was what they were after. In response, custom builders began wiring simplified versions of the exact same controls used in the amplifiers either into metal boxes that could be wired up into the instrument cable, or directly onto the tops of the guitars.
The diagrams for the famous Rickenbacker "frying pan", arguably the first true production electric guitar, at least took the need for volume control into account; the design submitted to the USPTO in 1934 included an inline volume control. Custom archtop acoustics with pickups mounted had master volume and tone controls mounted since the mid-30s. The iconic designs we have today, first the Gibson L-series, then the Les Paul, the ES, the Broadcaster/Telecaster, Stratocaster, SG, etc. all had these controls because they were demanded by players, having gotten used to them on their modified acoustics.
Nowadays, the modern examples of these guitars have the electronics configurations that they do because the guitar simply wouldn't be a Tele, or an LP, or a Strat, without the same control configuration seen on the instruments used by the idols of the guitar world in the 50s through the 70s. The exact reason you'd want to remove them (or replace them with updated, more transparent "active" preamplifier controls), to get the raw sound from the pickups into the amplifier, is the exact reason they can't be removed; it would change the tone of the instrument, and it would no longer sound like the guitar's ancestors.
That said, there are always those that bucked the trend. Nikki Sixx modified his bass to remove the electronics completely, save for a single mute switch. Eddie Van Halen built his iconic Frankenstrat from scratch, wiring it without tone controls in part due to his limited knowledge of guitar wiring. While active circuitry in guitars has seen relatively limited adoption, the same cannot be said of basses, where active preamps are common though still not ubiquitous (still plenty of demand among players for the traditional passive designs).