In Mateen's case, he was known to be unstable (ask his ex-wife and coworkers) as well as harboring extremist sympathies. That may not be enough for an outright arrest as you say, but if he were being watched closely, there's a distinct possibility he could have been stopped before he ever pulled the trigger. The far greater problem is that the authorities were warned, they had a pretty good idea the guy was trouble, and they still didn't meaningfully act. Heck, the guy shouldn't have even been able to buy a gun given the domestic abuse vs his ex wife if it were reported (or the FBI questioned her), let alone being on an FBI watch list previously.
It's also important to keep in mind the material components for other attack vectors are perfectly legal up until you actually do something with them. Take
this attack against another gay bar or
this arson attack against a New York night club. Gasoline is a perfectly legal thing to own, drive around with in a container in the back of your vehicle, etc. How does one stop this sort of attack, except with actual intel? How does one stop an attack like the Boston Marathon bombing and
similar attacks you can read about here? One might note this part as well
Supposing Mateen had a couple of six shooters, speed loaders, and a couple Molotov cocktails (very easy to make, legal components, and an effective incendiary), he could have been just as deadly attacking a jam packed night club at 2AM. Or suppose
this guy goes nuts if you don't think a revolver is capable of rapid, accurate fire.