A bar is added when deleting the last repeat mark. Why?

If the last bar has a repeat mark and you decide to delete is, then the repeat mark disapears (of course), but a new bar is added. Why?

It’s a side-effect of the fact that a repeat barline is actually part of a time signature. If you do Write > Trim Flow, the extra bar will be removed again.