No this was not lashing out blindly. I don’t know why those building were hit but there was a reason. Iran is not as stupid as everyone thinks.
I think it is probably execution of contingency plans made in case the Iranian leadership was successfully attacked. Local commanders may have opened their safes, read their assignment, and executed.
They’re not stupid. But they are desperate. Desperate people do stupid things. And these acts of desperation are creating new enemies where there were none before.
CC