A New Jersey man was arrested in error for failure to pay a fine and was then subjected to a humiliating series of invasive searches that included being asked to lift his genitals and cough while squatting.

According to five justices on the U.S. Supreme Court, that’s just fine. Fortunately, Maine law says something else. In Maine, jail officials are required to use discretion when they bring people into their custody.

Strip searches are only permissible in cases of violent crimes, drug offenses or at times when jail officials have a reasonable suspicion that the person under detention might be concealing a weapon or contraband.

That standard was not followed in the New Jersey case, but it makes sense. The Maine Attorney General’s Office agrees and has advised jail administrators to follow the established rule, despite the Supreme Court ruling.

Just because the court says jails can do something, doesn’t mean they should. Maine is not the only place where a reasonable-suspicion standard applies. The American Correctional Association advises a standard that strip searches should only be used when there is suspicion. That standard recognizes that strip searching is humiliating and dehumanizing.

It is extreme treatment that punishes people before they have ever been convicted of a crime. Jail officials have extraordinary powers to maintain safety for staff and other inmates, but they also have a duty to use those powers responsibly.

The Constitution is supposed to protect us from unreasonable search and seizure. Routine, unwarranted strip searches for people accused of civil infractions and nonviolent crimes should have been outlawed by a court that is supposed to value individual liberty over government overreach. Instead, the five most conservative justices backed the government and left the individual at its mercy.

But Maine law requires the opposite approach and Maine jail officials should continue to follow the state’s reasonable requirements.