It's not that both my parents are strict with me.

Literal

Parents [subject-が] two-people-both me [to-に] strict [it's-not-the-case-that-わけではない].

~わけではない is partial negation — 'it's not the case that both are strict,' implying one parent is actually quite lenient. 厳しい (strict/harsh) takes に for the person being treated strictly. 二人とも (both of them) sharpens the scope of what's being qualified.