Well, two problems with that line of thinking. First, your home security camera doesn’t differentiate between a trespasser and a guest. It just sees motion, and starts recording. And if you record the audio of a guest, you are technically in violation of the law in many states (not that this is likely to get you in trouble provided you don’t publish it, since no one but you will know that the recording exists).
The second is that not all states have laws on the books which carve out exceptions for recording burglars talking. California, for instance, has a carve-out of its consent rules which say you can record audio without consent if it will be used to prove kidnapping, extortion, bribery, or a violent felony. Burglary doesn’t fall under any of those categories and so as things currently stand, recording audio of your burglars talking is still illegal.
While it would be reasonable for a judge to immediately strike down the portion of the law that makes recording audio of crimes in your own house illegal should you ever find yourself in court over it, it’s important to remember that judges don’t always do the reasonable thing.
And the flip side of that is the “clean hands” doctrine, which basically says if someone is pressing charges against you for recording them illegally, and the recording is an issue because you recorded them committing a crime, they don’t have “clean hands” in the matter and since you were acting in good faith (you’re recording to try and prevent crime) and they were acting in bad faith (they were trying to increase crime), that can sometimes be a valid defense - but if it doesn’t work, you might still be in trouble.
Having grown up with a dad who was a lawyer, one thing he used to say all the time was that the justice system isn’t always just, or fair, or logical, which means that even if you are 100% in the right, you can still sometimes find yourself in trouble if the law can at all possibly be interpreted against you.
That’s why my security cameras don’t record audio, and if I had a dash cam I’d disable the audio.
Actually I’d disable the audio anyway because nobody wants to hear me singing along to the radio.