I still don't get the point of making 4 door versions of the 4 or 6 series. I guess there is a market for them, but seems to me it takes away sales from the 3 and 5?

Take away sales? No, they end up paying more at the end. That's called marketing/business.
People who initially wanted 3 series now have opportunities to pay more and get the 4er.
It totally makes sense or maybe you need to study how business works.