IMO it has to be based on things like the band's members, skill, creativity, influence, longevity (combined with sustained originality i.e. not being stale for 20 years), personality, quality beyond hype, passion and just their general story. Not necessarily based on which band wrote/performed the best songs. Personally I like hearing about the history of some bands and reasons as to why they are like they are, makes them interesting, and for me that's why a lot of the trash going around today can't be considered 'great' in the long term; no substance beyond hit singles and contract figures.
My idea of a great band is one that plays music just for the sake of playing music, and doing so with a mutual spirit and love for music. The greatest bands take that ethic and turn it into success on their own terms. So I'm going to have to jump on the bandwagon and say the Beatles, though there are other bands that I admire because of the way they function and succeed as a band so I can't definitively answer...