At first one might assume he did this to torture her. But is blowing up someone's workplace really the best way to do that? Most mornings, if you opened an email that said, "office just exploded. don't bother coming in today," you might consider it the greatest news you've ever received. But besides the fact that this would be a strange way to torture your enemy, it's pretty clear Silva really wanted her dead and simply screwed up. Because for the entire rest of the movie, he makes attempt after attempt on her life in increasingly contrived ways. He's not a man trying to destroy the things M loves most. He's just bad at murder.
He continues to fail to kill her while she's in locations way, way easier to rig with explosives than the headquarters of the most secret division of the British Secret Services. And this long saga of heavily planned assassination attempts ends when M is shot not in a personal confrontation with Javier Bardem's weird hair, but because of a random stray bullet from a random henchman. It's like setting up the ultimate laser death trap, waiting for days, then finding out your intended victim died of heart disease and their dying words were about how they didn't remember you.
So yes, Silva's misuse of a surefire way to kill his main target five minutes into the movie was pretty stupid. And all his failures after that were kind of stupid. But there is a silver lining! By underestimating M's ability to survive random encounters with random henchmen, he succeeded in making Bond the completely disposable sex object in his own movie. Which is maybe the most poetic revenge any 007 villain has ever pulled off.