Most people don't know this (I didn't until I took criminal procedure in law school). But, in a nutshell, under the law, police are allowed to lie to suspects when they are not in court, but are not supposed to lie in court. In contrast, district attorneys and public defenders and judges aren't supposed to lie at all, nor are they supposed to have staff lie on their behalf. The Legal Theory Blog today features an article that largely supports this status quo.
In other words, in interrogations, police are allowed to do things that would be felony perjury if done when the policeman is being interrogated in an internal affairs investigation, or is in court.
Personally, I'm not convinced that this status quo is a good thing. When the legal system tells police that they have a license to lie in pursuit of law and order some of the time, I believe that this has a corrosive effect on public trust in the police, and on police perception that they must tell the truth in court. It also reinforces the "blue wall of silence." Scandals in which police, for no personal gain of their own, have lied in court in an effort to convict people whom they believe are guilty are not uncommon, and I believe, are not unrelated to the fact that they are often permitted to lie for the same purpose prior to getting to court.
(I think a similar phenomena may be at work with physicians who widely believe that it is O.K. in some circumstances to lie to patients to protect their morale because of the belief that this is important to patient health.)