WHY WOULD HE DO THIS AT THE FUCKING SCHOOL???? WHAT THE FUCK?!
Maybe his mental issues were so bad at that moment that he didn't think about it further.
Or maybe he though about it and thought it would show her wife how serious he is about this.
People with mental issues and who have already decided to kill themselves don't think straight. They might be consumed by anger and other things so much that they would not see the negatives in what they are doing, or are actually thinking the negatives are the positives when it comes to having a revenge.
For example, there was this woman in Finland who had been arguing with her spouse. The spouse then went on a work trip with a bus. She followed him. She stopped the bus on a bus stop and went in to argue with him more. She was asked to leave the bus. She left, thought fuck it, drove past the bus, made a U-turn and drove towards the bus at high speed and crashed.
She died... along with her 1, 2 and 6 year old children who were in the car. No-one in the bus died. Imagine what the guy must have felt... Two of the kids were his biological children too. She must've been thinking about it as the ultimate act of revenge on her part. Like "I hate you so much that I will let you witness my and our kids deaths."
When people go crazy, they go crazy. They don't think, except in some super twisted logic at that point.