Despite being a hardboiled tough guy, Marlowe has his own set of principles that he sticks to firmly. Marlowe sees himself as a modern-day knight, following a code of chivalry in a fallen society that no longer knows the meaning of integrity and honesty. In a depraved city where everyone is out to make (or steal) a quick buck, Marlowe remains underpaid and even refuses money when he feels he hasn't performed his job satisfactorily. Even though he realizes that his efforts are mostly futile, and will only end in The Big Sleep, Marlowe isn't afraid to admit when he's wrong and this honesty with himself enables him to preserve his own sense of dignity.
Marlowe's principles do nothing but stand between him and solving the case. If he'd gotten down and dirty sooner, this case would have been closed ages ago.
Marlowe should uphold the law, no matter what. The fact that he breaks it now and again just means he's just as bad as the rest.