When I select a text and delete it, InDesign also automatically deletes a space behind the text as well. Is there a way to change this behaviour?
What's more annoying is when ID doesn't remove trailing spaces before a linefeed and the space is used to calculate centering, throwing things off.
I don't think there's a fix for what you're asking.
InDesign appears to remove spaces if a glyph follows them.... but leaves spaces if no glyph, or a linefeed, follows them.
I have filed Adobe bug reports regarding this issue... but that was many, many, years ago and the behavior hasn't changed.