To use a Nether portal or an end portal, for that matter, you have to first switch to another game mode. Once you are in the new dimension, you can switch back to the spectator game mode.