The original 1951 UN Refugee Convention had geographical and time limits. It was written with the post-war problems in mind. Those limits got removed in 1967 - before mass travel took off and smartphones were a thing - and then the ECHR codified the principle of non-refoulment (sending people back to where they came from because of credible torture threats).
In a nutshell, that's our problem. If an Afghani rapist can't be sent back, what do we do with him? And yes, we have our own homegrown rapists (and I have and do campaign for swifter justice, better courts and supporting survivors), but that does not mean we should let anyone in without cvetting. People who come the iregular route know damn well they would not get a visa any other way. The Danish data also shows that men from certain countries do commit rape at a higher per-capita head than the native population. Excluding groups that have incompatible values with ours is not rocket science - we already do it for ISIS supporters.
Ultimately, I think we need to return to a pre-1967 settlement and have geographical/time limits combined with explicit routes for economic migration, faster third country applications/processing/return and more help for the neighbouring counties of war zones. We also need to sort out the problem of visa overstayers - that group is much larger than the boats, but not so photographic, so it gets ignored.