Why is false prophecy a death penalty crime?
From Theonomy Wiki
The definition of a (Biblical) prophet is someone who claims to be speaking for YHWH. If this claim is true, those words carry ultimate authority. Therefore, putting false words in the mouth of YHWH is the ultimate misrepresentation. It is using YHWH's name in vain (Exod. 20:7).
Think about how angry you would be if someone went around claiming that you said something which you didn't say. Especially if those words changed the decisions people made, or how they acted towards you.
YHWH sent prophets to warn people to repent. If the prophets didn't warn, then they were merely confirming people in their existing sin:
YHWH even sent prophets to warn about false prophets: