Seems pretty easy to me: in (much of?) New England, if the check engine light is on, automatic inspection fail. At least for '96 and newer vehicles with OBDII. If the readiness codes aren't set, automatic fail. Police write nice fines if you get caught driving a vehicle with expired inspection sticker.
Here's the thing: one could remove the equipment, then reinstall for inspection purposes. But for most people, that's simply too much work. They'll leave it alone.
The only loophole is that sometimes one can "fool" a car into thinking everything is correct. O2 sensor simulators for example. I'm not sure how widespread of a problem that is, nor if it's worthwhile (at this time anyhow) to go after those who would modify vehicles in this manner. I get the impression that often, these hacks are to eek out a few more years out of a jalopy, not hacks on a nearly new vehicle.
But given the test algorithms I'm thinking it's not that easy to fake a system out.