While some spacing differences between Live Preview and Reading views is expected, that seems excessive. Also, iirc, Obsidian uses CodeMirror for code syntax highlighting in live preview and PrismJS for reading view, so you’ll see differences there as well.
A new vault with no settings changed in live preview mode: