...My understanding is that the monarch’s role in the church is established by law rather than just tradition. In this respect, the British monarchy is different from many other monarchies around the world. King Philip VI has no official role in the Catholic Church; the Spanish monarch is no longer known as the ‘Catholic Majesty.’ Similarly, monarchs in Arab countries do not have official roles in the Muslim religion...
Comparing the relationship between the CoE and monarchy on the one hand and Catholic and Muslim realms within their own religions is a bit of an apples and oranges comparison. Within Catholicism there is a designated leader - the Pope - and therefore on a purely religious level, any monarchs are beneath him. If I am correct, there are likewise heads of Islamic Faith, taking that power away from Muslim monarchs (although I could be very wrong here, I don't know a lot about Islam or Muslim monarchies). If you go back 100+ years, when there was still a state connection between the Roman Catholic Church and Spain, the king still would not have been the head of the church, while in Britain the same would not be so.
A better comparison would be between Protestant monarchies, as they have the option of having the monarch be the head of their church. If I'm correct, in Norway and Denmark the monarch is also the head of the church.
As to the idea that there is a point that Charles and Camilla have sinned and thus Charles is not living up to the higher standards that a man who will be the head of a religion... Well, yes and no. Yes, there is a point, and yes we should be able to expect more from our religious leaders and yes, Charles will be (but is not at this time) such a leader in a manner of speaking, but... It's not that easy.
First of all, Charles is human. Like all humans he is prone to err. He is religious, but life has not lead him down a path of being drawn to religious orders - sure maybe he would have had he been born in a different position, but as it was, he wasn't. Charles has not devoted his life to religious orders in a comparable way to the Archbishop of Canterbury or the Pope or any other number of more typical religious leaders, therefore to hold him to the same standard as other religious leaders.
Now, you could argue that based on those grounds Charles may not be suited to be the head of the CoE... And in a lot of ways I don't disagree. Charles is not a clergyman, so in a lot of ways it's ridiculous that he'll be the head of the church. His mother is not a clergywoman either though, and has been the head of the church for more than 60 years now. In fact, the CoE since its inception has not had a member of the clergy at its head. Instead it's had a slew of people of questionable morality in that role.
If the CoE believes that Charles is not suited for the role of Supreme Governor of the CoE then the CoE should end the connection between the church and the state in Britain. As it stands though, Charles' moral behaviour has no outcome on whether or not he's in the line of succession to the throne. There are only 3 conditions that he has to meet - be of legitimate descent from Sophia of Hanover, not be a Catholic, and not marry a person who is a Catholic. Charles hasn't broken any of these. Even supposing that Charles and Camilla's marriage isn't legal, it wouldn't prevent Charles from being king, because there is no rule that says a king can't have a mistress.
Back to the high moral standard we should be holding the Supreme Governor of the Church of England to though...
The church was basically founded under the reign of Henry VIII so he could annul his first marriage and marry again. He ended up marrying 6 times in total and kept a slew of mistresses, with two wives being his mistresses while he was married to their predecessors, and one of his sisters-in-law having been a mistress before he married her sister.
Later the head of the church was his Catholic daughter Mary, who defended the faith of Anglicans by burning them at the stake.
Charles II and James II were both known for their mistresses. James, despite being the head of the CoE was openly a Catholic, while Charles is often accused of having been a secret Catholic and had a deathbed conversion.
George I and George II were not members of the CoE until Queen Anne died, and George II is well known for his mistresses.
The sons of George III are also well known for their mistresses, including two kings, George IV and William IV. William even acknowledged 10 illegitimate children with one mistress.
In keeping with his predecessors, Edward VII had many mistresses in his lifetime, if no (acknowledged) children through them. His favourite, Alice Keppel, was even at his deathbed.
The only one of these previous monarchs who was deemed to be unfit to rule was James II, and only then after ruling for 3 years and doing a less than satisfactory job at it. Seriously, if a man who is of the wrong religion, had no fewer than 7 illegitimate children, and had at least 11 mistresses can be given a shot at being monarch and Supreme Governor of the CoE, I think Charles should be given a pass on his behaviour.