Technically Flarum isn't removing any whitespace, the browser is.
The spacing is rendered verbatim in the HTML, it's just that by default the browser collapses multiple spaces in HTML during rendering. Depending on your email software, you might actually see the multiple spaces in the notifications emails.
I'm not even sure how you would technically render spaces as actual spaces, you'd have to convert them to non-breaking spaces, or wrap them in additional spans with CSS rules.
You could change the whitespace rules with CSS for the whole post. But this could have side-effects on other content that gets outputed with spaces.
Theoretically non-breaking spaces should work for this, however I'm not having much success when I try copy-pasting a non-breaking space in the Flarum editor, so not sure what's going on.
The easiest solution for forums that have a legitimate spacing need might be to introduce a bbcode or special syntax that does just that, like for example a [tab]
inline block that renders an empty span with a fixed CSS width. You might even be able to provide an alt text for assistive technologies to explain the space to the visitor when using text to speach. Or you could add a [nbsp]
code to make inserting a non-breaking space easier.