She was the daughter of an earl (about as high up as you can get in the aristocracy without being royalty), she had no qualifications, she was ever only raised and expected to 'marry well', as soon as possible.
Charles was the top prize, and I think it was expected that she'd get on with producing the heirs and then sit quietly back cutting ribbons and living in palaces. Love didn't really come into it, and once she'd had her children she could had have a discrete boyfriend. She had no need to live with Charles, just have a public life with him. Her boys were off in the care of nannies and boarding school, so she wasn't tied to her children's needs.
Everyone around her encouraged the marriage, and she had no life experience to judge whether that sort of arrangement would suit her.
If it wasn't Charles, it would have been some other titled man, but I think the media interest in her played into some of the worst aspects of her personality and no one, including her, really knew what to do with her once she became bored and unhappy. Too late she realised just how little say she had in things, and how little power she had to change anything. That made the whole situation so volatile.
But aristocratic marriages don't have the same expectations as normal marriages - the money, the need for heirs and the avoidance of divorce (and therefore having to split family estates) distorts things.