Having a new line at the end of a code block is really useful when copying to a shell. Preserving it makes the last line execute as well. Now Obsidian trims the whitespace when copying I presume, which breaks this use case. There are probably other use cases for when you would want an exact copy with whitespaces and no meddling from the app.
It looks like new lines don’t get trimmed entirely, only 1 new line is removed.
Which means that 0 new lines become 0, 1 becomes 0, 2 becomes 1 when pasted, which is also weird and unintuitive to me.