There is a rather interesting explanation as to why only sodium ion can pass through a cation exchange membrane and chloride ion is repelled by it.
Let us recall some properties
a) Ion exchangers are very good electrical conductors. This is well studied in the 1940s. The current is carried, not by electrons but by mobile ions in ion exchange resins. In a cation exchanger, current is carried by mobile cations.
b) Imagine in the cation exchanger, it consists of a sulfonated polymer. Let us call that R-SO3H, where H is mobile and R-SO3(-) unit is immobile.
c) Ignore the flow of the chlor-alkali cell for the time being.
d) The punch line is that the bulk solution has to be electrically neutral all the time.
Now consider an electrolytic cell which consists of NaCl solution. There is a partition of a cation exchange membrane in between. On the left there is an anode where chloride ions are being oxidized and the right, water is being reduced to hydrogen.
Right hand side:
When water is being reduced, neutral hydrogen gas is leaving the solution, leaving behind negatively charged hydroxide ions. There is a charge imbalance in the bulk which cannot exist. What has to happen? Na(+) ions must cross the cation exchanger from the left hand side to ensure there is no bulk charge imbalance.
Now chloride cannot pass through the ion exchange membrane because the R-SO3(-) has a negative charge. All it can do is to repel the negatively charged chloride ion. You can read more about Donnan effect and Donnan potential.
Left hand side:
You are losing negatively charged chloride ion as neutral chlorine gas. There is excess positive Na(+) ions there. The positive ions have to cross the membrane in order to maintain electrical neutrality in the bulk and eventually join the free hydroxide ions.
As a combined effect, the right hand side becomes a solution of NaOH (contaminated with NaCl) and the concentration of NaCl on the left hand side depletes.