Thanee
The rules:
You can cast spells, which are on your class list.
You can learn spells (no mentioning what spells).
So, even if you learned a spell not on your class list, you could not cast it, which is obviously pretty pointless then.
My conclusion/interpretation of the intention (and a rather obvious one):
You can only learn spells, that you can cast.
Extra Spell:
You can learn an extra spell.
Option 1) This spell can be any spell. But if it is not on your class list, you won't be able to cast it. (That second part it the rule.)
Option 2) This spell has to be on your class list, because you need to be able to cast the spell. (This is using my interpretation of what spells one can learn.)
Except, Thanee, there are Feats out there that allow a PC to break a basic rule.
Example: the basic rule is that a human's punch is a non-lethal attack that doesn't count as being armed, and thus provokes AoOs. Improved Unarmed Combat, however, changes all of that.
Thus, it is no small leap that Extra Spell could be read as:
Extra Spell
You can learn an extra spell.
Option 3: This spell can be any spell. You can cast it as if it were on your class list.
Which, BTW, is how I personally rule it.