If you middle-click a SAM you own, and have at least 3.00M gold, that SAM gets upgraded. This is normal and expected. But if you middle-click a SAM and have 2.99M gold, and there is a nearby building, that building gets upgraded instead. And now you have 1.99M gold. This is really upsetting when a hydrogen bomb is coming in, and you are desperately trying to upgrade your SAMs before it reaches you. Middle-clicking a SAM should either upgrade it or take no action, not spend gold (which takes you further away from upgrading the SAM).
If you middle-click a SAM you own, and have at least 3.00M gold, that SAM gets upgraded. This is normal and expected. But if you middle-click a SAM and have 2.99M gold, and there is a nearby building, that building gets upgraded instead. And now you have 1.99M gold. This is really upsetting when a hydrogen bomb is coming in, and you are desperately trying to upgrade your SAMs before it reaches you. Middle-clicking a SAM should either upgrade it or take no action, not spend gold (which takes you further away from upgrading the SAM).