It seems that this is not a problem on the CodeCogs side since the equation editor works fine with many spaces or newlines. In fact it seem that the part where you copy to document from the equation editor was designed to translate (by removing/cleaning the extra newlines) for phpBB.
I guess I simply have to learn that "copy to document" function/button and implement it in phpBB for the tex tag.