It is related to the
fill rule.

If you combine two paths, the fill will be based on each subpath's direction. If they all have the same direction, it would appear as the original red square.
There is an option of reversing the direction of the paths at the path menu.
Also in this case simply mirroring one of the squares would do the trick.