One of the deeply beautiful things about the guitar is this "ugly" asymmetry. People with analytical minds that desire order always get bothered by this 3rd, why not go to all 4ths and be more elegant???
Because art and music arent always about being elegant! Tuning a guitar in all 4ths lets you play like a snooty stuck up jazz musician, but ultimately there are so many richer bar chords available with that 3rd in there that who cares if it is "ugly" to have the 3rd. People forget a plain jane normal guitar chord like a G chord or something is tonally actually very complex. It isn't like a basic g chord on a piano G B D. The "basic" G chord on guitar spans many octaves and has a non-obvious combination of notes. The 3rd in there for guitar tuning allows you to explore all those complexities with the given limitations of the human hand best.