In some senses, it would seem that the Fourth Amendment makes it illegal for the police to use roadblocks. After all, you have a right to avoid searches and seizures without probable cause. Police need a warrant. In most cases, without that, if you are stopped by a police officer and you ask if you're free to go, he or she has to let you go.
Is a checkpoint or a roadblock any different? Yes, according to the U.S. Supreme Court. A roadblock is different.
The Supreme Court said that roadblocks could be used if they were effective in achieving whatever objective they had been constructed for, as long as the state had an interest in accomplishing that goal and it wasn't excessively intrusive.
For instance, roadblocks are often used on the border to stop illegal immigration. The court found that border security was important enough to force drivers who had done nothing wrong to stop. This wasn't seen as excessively intrusive considering its effectiveness and the goals it was trying to accomplish.
The Supreme Court also said authorities that could use roadblocks when those authorities had "special needs, beyond the normal need for law enforcement." This is vague, and the court hasn't done much to clear that up, but it does at least show that there must be some reason for the roadblock beyond standard police work.
Obviously, checkpoints and roadblocks are in a gray area, and they're controversial as a result. If you think your rights have been violated, you need to know all of your legal options.
Source: FindLaw, "Can the Police Set Up Roadblocks for Any Reason?," accessed Jan. 19, 2018