One wonders why the Federation was so surprised by the deep-rooted Malcorian fears of alien invasion or other major change. The infiltration missions should have highlighted that very thing, now shouldn't they?
We could always presume that Riker's mission was one of the first, and that the local atmosphere of paranoia was indeed revealed early on, but disastrously so. This seems a bit unlikely, though: why would the first officer of a roaming starship be involved in a long-term surveillance endeavor? Shouldn't these early phases be the job of dedicated specialists who have nothing better to do with their professional time?
The fact that we mainly observe the Malcorian side of things rather than the Federation one helps here, though. We don't learn everything about this infiltration program. How much did Riker's capture hasten the process? Was Picard ready to beam down to the presidential palace in a matter of days in any case? Were the preliminary studies careful but faulty? Or did the UFP recognize it would be taking a great risk when contacting the government (and also deciding that openly contacting the general population would lead to an unmitigated disaster), but proceeding anyway because of the time pressures from the Malcorian warp program? Many a thing is possible, and the complexity of the situation can be fully appreciated without our heroes spelling it out.