The Torah obligation for two witnesses was never how Jewish society operated. As has been pointed out by many, it is impossible to run a society that would require two male witnesses – not to mention the requirement of warning a perpetrator – in order to punish criminals, as such a system would not be able to convict anyone and thus would not have any power of deterrence. (Why the Torah has rules and procedures for criminals that can’t be implemented in the pre-Messianic world is a topic for a future post.) Jewish courts always did what they thought was necessary in order to secure order, and halakhah gives them this authority. To say otherwise is itself a hillul ha-shem because it means that when it comes to dealing with crime Jewish law is unworkable, while the truth is that Jewish law can deal with every possible situation.
Marc B. Shapiro, “The Vilna Gaon, part 3 (Review of Eliyahu Stern, The Genius)”, The Seforim Blog (23 February 2014) [http://seforim.blogspot.com/2014/02/the-vilna-gaon-part-3-review-of-eliyahu.html]