Charles married Diana in the centuries-old tradition of European royalty: Wedding a certified virgin to beget a legitimate heir for all the world to see, the better to avoid murderous struggles over the succession. (Even today, British royal births are public affairs, with palace officials standing by.) Fidelity could hardly be expected of him, nor of her, once she had produced the heir.
It was an accepted trade-off. He got an heir, a Queen and no interruption to his love life; she got a title, royal children and a postponement of hers. As a system, it used to work well enough.
A lesson in understanding the bargains that you are making: and sticking to them as well.