That's a part of Construct2. If you delete an object or a variable, it deletes any references to it in the code (since the code would be broken, referencing something that doesn't exist).
You have to remove those kind of parameters references manually before deleting the variable. Or, if you have multiple sprites with the same variables, put them into families and assign the variables to the family, so you can add and subtract sprites without jeopardizing the code.