And the Ninth Circuit agrees with you. There are cases in the ninth, which is I think where you live, directly on point. The Supreme Court has ruled that in so-called "knock and talks," which is what this is, police officers without a warrant or exigent (emergency) circumstances may only knock and wait (briefly) at the door. They may only engage in such conduct that any member of the general public is invited to engage in by social custom.
That ruling did not directly address invading privacy by peeking in windows, put most circuits have put that sort of behavior off limits to the police, including what I believe is your circuit.
While on your porch or in reaching distance of your window, the police officer is within what the courts have defined as the "curtilage" of your home. Your home's curtilage shares the same fourth amendment protection as your living room.
No warrant= no-go.
In most circuits, peeking through a window is a plain fourth-amendment violation absent exigent circumstances or a warrant.
And it's a probable violation in all circuits.
The sergeant you spoke to undoubtedly knows that. He's gaslighting you.
He's also counting on you not filing a civil lawsuit. Because he knows that takes money, monetary damages are often small, and most people will never bother.
Taking a photo is a different question, I believe. Taking a photo of the inside of your house through a window could be a fourth amendment violation, case law is not settled on that. But taking a photo of the outside of your house, even from within the curtilage, is probably legally permissible, based on the idea that any member of the general public could do that.
But in any case, I'm so sorry to see you being victimized by the increasing nature of our police state. You should not have to put up with that, and you should especially not have to be gas lit about it by somebody who clearly knows he is gaslighting you.