Resonant stripping as the origin of dwarf spheroidal galaxies