According to Marlowe, there is a huge difference between law and justice. As someone with a strong personal conscience, Marlowe feels that the law often is just not up to snuff when it comes to bringing the bad guys to justice. For one thing, Five-Os, according to Chandler (and Marlowe) are totally corruptible. Policemen accept bribes and dole out false information. And for another, in The Big Sleep, sometimes working outside the law is just more effective. For Marlowe, law breaking isn't necessarily the same thing as being immoral, especially if bending the rules allows him to reach justice.
Marlowe considers himself to be a modern-day knight fighting for justice, and yet he is willing to break the law to find the truth. Double standard, much?
Marlowe has to break the law every now and then because the cops are breaking it, too. That makes the law pretty worthless, so he'd rather just serve justice instead.