"It's against the rules. Read the handbook".
THIS is your ANSWER.
Read the handbook and if you still have questions edit your question or ask HR.
Something in that chain of events you described violated at least one policy in said handbook (at least according to its interpretation of the company / HR).
I URGE YOU TO CONSULT A LAWYER!
Engaging in inappropriate conduct is a serious offense raising all sorts of red flags.
See what your chances are in expunging this from your documents.
If it has no merit, if HR's interpretation of the policies in the handbook was false, a lawyer will be able to help you!
EDIT: Seriously, downvoters, the issue is OP was told he violated a policy.
WITHOUT knowing that policy we CAN'T answer any differently.
Idle speculation won't help OP and aimless rants about the sense of rules encompassing private relationships with colleagues are way out of the scope.