What is the highest level spell ever published by TSR or WotC for any edition of D&D, and what source might it be found in?
This is most likely going to be the 12th level spell, Karsus's Avatar, published as part of the Netheril: Empire of Magic box set for 2e, and detailed in Powers and Pantheons, page 36.
(Wiz 12; Invocation/Evocation, Enchantment/Charm, Alteration)
Range: Unknown, probably 0
Components: Unknown, probably V/M
Duration: Unknown, limited
Casting time: Unknown
Area of Effect: The caster
Saving Throw: Unknown
The only 12th level spell ever created, this incantation enabled Karsus to steal the power of a deity. All notes and information developed by Karsus regarding the casting of this spell were destroyed by Mystra, successor of Mystryl. Even if they were recovered, this spell could never again be cast since Mystra has changed the way magic works, making 11th and 12th level incantations impossible.
This spell required countless unique and currently impossible to acquire material components. For example, Karsus had to dip a gold dragons gizzard in a brew of tarrasque blood and bile from a 12 headed hydra just to enchant one of the many material components required to cast the spell.
Note: 3e had a feature known as the Epic Spellcasting feat, included in the Epic Level Handbook, where 21st level wizards could take the feat and create their own Epic level spells. These always counted as 10th-level spells, no matter how powerful, but a few were cataclysmic in nature.