Because you type the message like this:
Code:
<table>
{NEW LINE}
<tr>
...
All new lines become <br />'s (nl2br() function), so the line breaks actually show up in the HTML document.
A workaround I can think of right now is putting
<!-- HTML START -->
<!-- HTML END -->
Before and after any HTML code in your post, then run some regular expression to remove breaks in that block.