Three reasons:
- compatibility with arbitrary Markdown implementations,
- safe user input,
- layout-independent content
Standard Markdown does not support tables. It is intended to be just like e-mail. SO uses standard Markdown, so no tables.
Some Markdown extensions support tables, but they are not compatible between each other, which invalidates the idea of Markdown, because the content becomes dependent on a particular Markdown implementation.
So, the tables can be made only with HTML-inside-Markdown. Which is also not good. I am sure that Markdown2PDF, Markdown2TeX and Markdown2TheNextBigML converters are easy to write. Converting Markdown with embedded HTML to anything but HTML is not trivial. So there is no point to store everything in Markdown (plain text), if (some) embedded HTML is allowed.
Another reason to sanitize all user-submitted HTML is obvious, it is too difficult and expensive to parse properly, and it can break the layout (e.g. <table width="10000" height="10000">
).
Finally, there is a huge benefit in a lightweight (pure Markdown) markup: it does not depend on a particular site layout (screen width, paddings, margins, justification, column widths, etc.). So if a SO redesign happens a year from now, the content does not need to be edited (HTML snippets depend on a particular CSS implicitly). Additional bonus: easier to use in third party applications (like mobile phone clients).