It was British Law. They were forced to marry in CofE Churches because the marriage wasn't legal under British Law if it was in there own Church.
It was changed sometime in the 1900's I believe.
Just as an fyi, do you know right now in British Law a Muslim Hindu Sieke Jew etc etc etc, every religion can marry into the Royal Family and become Queen, any religion except Catholic, even now!
One of the 'heirs to the throne' married a Catholic in the 60's and had to forgo his right to the throne even though he was something like 200th odd in place.
Crazy eh?