This tends to happen if the editor messes up the BBcode, like:
Code:
[center]some text[/center]
[center][spoiler][/center] <----
[center]spoiled text[/center]
[center][/spoiler][/center] <----
[center]some more text[/center]
You can fix it by cleaning up the BBcode around the opening and closing tag of the spoiler.
To switch to BBcode mode, use the button on the top right.