Switzerland is part of Schengen but not part of the European customs union. That means they have to split you into the appropriate customs line.
For example, if arriving from the UK, you would need to declare goods to customs on the Swiss side, but not if arriving into France.
A Schengen immigration inspection is required in both cases and they could, I suppose theoretically have a single immigration line, but historically they used to be separate and I suppose that they haven't solved the bureaucracy of who would pay and run the single line.