Having travelled the highways and country roads for many years I have come across vehicles stopping to be inspected, as I am sure you have.
Yet, consider this for a moment, how many cars and trucks out there are really really safe?  We all
procrastinate a little, do something later, save it for a rainy day kind of atitude. If the bearings for example were wearing and making a noise on your car or truck, depending on where you go, the mechanic might suggest  - its not too bad, we can catch that next time you come in for service. But what if there were a catastrophic failure and the wheel were to come off, parts flying everywhere and you are cruising at 100 down the highway?
Now, thats a scary thought.

Here is the point. Those trucks you passed being inspected were most likely semi and small commercial rated vehicles. Some would need to remain parked due to numerous infractions, yet the vehicles passing by might not pass the inspection if they were pulled over. But they are regular passenger cars and the onus is on the driver to maintain the vehicle. But how many really do, seriously? Bald tires, poor brakes, loose battery ends, who knows what else. Until you come across an accident. Oh my gosh, someone crossed the center line, someone was on the wrong side of the road, someone fell asleep, someone had not looked after the maintenance of a vehicle and now the result - a multi car accident. Some dead. Some dying. Some shaking their head and trying to figure out what happened. And yes, after the fact it was discovered that Mr. Lousy Maintenance did not care for his car. Yes Mr. Lousy Maintenance should go to jail. So on and so forth.

Good things to think about and sadly most of the important issues are often discovered too little, too late.