there is an inherent social contract w.r.t. freedom and the societal notion of collective liberty -- freedom provides agency to both good and bad actors.
a free society implicitly accepts this as a risk-reward in order to maximize freedom, therefore a social contract.
and the social contract boils down to a government's obligation to secure its citizens (dependent on the boundaries of the implied social contract and what its participants agree to), and whether or not the balance between security and freedom is agreeable for parties involved.
constantly advocating for more security, at all costs, in order to stop "the bad guy", and then presenting a straw man to rhetorically justify it by asking: how else do we stop the bad guys, is authoritarian, anti-freedom, and patronizing.
freedom has an inherent risk of, well, freedom.
law was a construct designed for accountability, not deterrence, nor prevention because its [modern] philosophical (post french revolution) motivation is centered around optimizing for freedom (ie: political liberalism) and recognizing that actors will act -- it just attempts to add the checks and balance idea which attempts to ensure (that is, uphold a social contract), that bad actors are held accountable for their (free) actions.
you'll never be able to magically "legislate" away bad actors, but you can certainly attempt to "control" them, which presents a very, very large slippery slope of positive and negative definitions, and nuances around objective suspicion and other faculties used for discernment w.r.t. bad actors -- all of which directly violate the philosophical (US) notion of innocence until proven guilty, and very much so move away from any kind of scale where freedom is (attempted to be) balanced.
if you want freedom, you can't just erode the social norms built on foundations of trust, agency, and liberty in order to prevent bad actors from acting freely -- what you're calling for is not a free society by definition, because it seeks to mitigate and or prevent agency before it happens (reminds me of Minorty Report), which is restrictive and anti-thetical to freedom.
freedom comes at a price. freedom is (not) slavery, and i have no interest in participating in a social contract that binds me to chains through freedom risk-averse framings of governance.