Legally, she may have used it as a very powerful tactic.

Emotionally, she wanted to "possess" you again -- to get back the emotional control over you that she no doubt felt she had lost.

Just google "tagging" "sex" and do some reading on it. It's more common than you think.

Why did you fall for it? Because you are human, and you were weak. I did too, although not until much further along in the process. She had ended her affair, and we were reconciling, but I had made "No ML until you get a full-panel STD test, and show me the results" one of my boundaries for taking her back. And I totally caved on it, and it weakened my hand greatly.

Puppy