on the wrong/right side of the law
From Longman Dictionary of Contemporary Englishon the wrong/right side of the lawon the wrong/right side of the lawinformalHONESTILLEGAL breaking or not breaking the law → sideExamples from the Corpuson the wrong/right side of the law• De Niro plays a lawyer, on the right side of the law.