The term you're describing is often referred to as 'spiteful,' 'vindictive,' or engaging in 'sabotage.'
Spitefulness involves intentionally causing harm or damage out of a desire to hurt someone else or prevent them from benefiting.
Vindictiveness involves a desire for revenge or retaliation, often resulting in destructive actions.
Both terms capture the essence of destroying or ruining something so that others can't have it.
Additionally, 'sabotage' encapsulates the concept of intentionally undermining or damaging something, often for personal or malicious reasons. It conveys the idea of deliberately obstructing others' access to or enjoyment of something.
So, to describe the actions you're referring to, you could say someone is engaging in sabotage or acting in a sabotaging manner.
The phrase "going scorched-earth" refers to any extreme or ruthless approach that involves causing widespread devastation with little regard for collateral damage or consequences. So, when applied to personal actions or conflicts, it implies a similar strategy of destroying or ruining everything, regardless of the impact on oneself or others, in order to prevent others from benefiting or gaining any advantage.