The alternative extreme is likewise unworkable.
"OK, before we begin this meeting of the capas of our totally legitimate, not at all criminal business... Is anyone here an undercover officer of the law?"
"Shucks, you got me. I'm FBI."
However, your implied extreme isn't accurate. Lying to suspects can in some cases result in entrapment charges (although it is historically more likely for suspects with power and public office). Etc.
Yes, the current system is injust. No, it's not as bad as you claim.
A reasonable exception can be made for undercover work without permitting most of the instances where police lie to people.