Why is false prophecy a death penalty crime?
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:
18 When I tell the wicked, ‘You will surely die;’ and you give him no warning, nor speak to warn the wicked from his wicked way, to save his life, that wicked man will die in his iniquity; but I will require his blood at your hand. 19 Yet if you warn the wicked, and he doesn’t turn from his wickedness, nor from his wicked way, he will die in his iniquity; but you have delivered your soul.” Ezekiel 3:18-19WEB
YHWH even sent prophets to warn about false prophets:
21 I didn’t send these prophets, yet they ran. I didn’t speak to them, yet they prophesied. 22 But if they had stood in my council, then they would have caused my people to hear my words, and would have turned them from their evil way, and from the evil of their doings. 23 “Am I a God at hand,” says YHWH, “and not a God afar off? 24 Can anyone hide himself in secret places so that I can’t see him?” says YHWH. “Don’t I fill heaven and earth?” says YHWH. 25 “I have heard what the prophets have said, who prophesy lies in my name, saying, ‘I had a dream! I had a dream!’ 26 How long will this be in the heart of the prophets who prophesy lies, even the prophets of the deceit of their own heart? 27 They intend to cause my people to forget my name by their dreams which they each tell his neighbor, as their fathers forgot my name because of Baal. 28 The prophet who has a dream, let him tell a dream; and he who has my word, let him speak my word faithfully. What is the straw to the wheat?” says YHWH. 29 “Isn’t my word like fire?” says YHWH; “and like a hammer that breaks the rock in pieces? 30 “Therefore behold, I am against the prophets,” says YHWH, “who each steal my words from his neighbor. 31 Behold, I am against the prophets,” says YHWH, “who use their tongues, and say, ‘He says.’ 32 Behold, I am against those who prophesy lying dreams,” says YHWH, “who tell them, and cause my people to err by their lies, and by their vain boasting; yet I didn’t send them or command them. They don’t profit this people at all,” says YHWH. 33 “When this people, or the prophet, or a priest, asks you, saying, ‘What is the message from YHWH?’ Then you shall tell them, ‘“What message? I will cast you off,” says YHWH.’ 34 As for the prophet, the priest, and the people, who say, ‘The message from YHWH,’ I will even punish that man and his household. 35 You will say everyone to his neighbor, and everyone to his brother, ‘What has YHWH answered?’ and, ‘What has YHWH said?’ 36 You will mention the message from YHWH no more, for every man’s own word has become his message; for you have perverted the words of the living God, of YHWH of Armies, our God. 37 You will say to the prophet, ‘What has YHWH answered you?’ and, ‘What has YHWH spoken?’ 38 Although you say, ‘The message from YHWH,’ therefore YHWH says: ‘Because you say this word, “The message from YHWH,” and I have sent to you, telling you not to say, “The message from YHWH,” 39 therefore behold, I will utterly forget you, and I will cast you off with the city that I gave to you and to your fathers, away from my presence. 40 I will bring an everlasting reproach on you, and a perpetual shame, which will not be forgotten.’” Jeremiah 23:21-40WEB