The same thing is happening to me - the only way to make Windows client keep formatting and alignment is to use the stupid code snippet button, which then creates so much wasted space in the chat message as it shows as an embedded object, sort of...
Regardless of whether I type in the code or paste it. Actually, it does not even matter if it's 'code' - it can be any kind of white-space formatting you put in....for example if you do not want to bother with bullets/lists but just type one line and another below it indented with a few spaces - it turns into two left-aligned lines.
I do not use Teams through web browser as I use it only on my work laptop, so possible double/triple ticks + space/enter magic tricks do not work.
Funny thing though - this forum is answers.microsoft.com...and yet, we have no answer why this issue keeps going on and on, how to get around it without 'code snippet' and why is the Teams behavior changing in such unpredictable ways.