Speaker of the House does NOT have to be a member of the House of Representatives or any elected official at all. It has never been otherwise (I’m fairly certain), but there is no Constitutional requirement that Speaker be a representative.
Even if a former “class” in the House of Representatives passed a requirement that the Speaker be an elected member, such a requirement can be eliminated by a majority vote of the current “class”. I don’t think such a requirement has ever been addressed.
I never knew that, thanks for new info.