Wilson was sent off after the final whistle for using offensive language to the opposition and he has been given a one-match suspension.
Jamie Walker had put Hearts in front before McHattie was adjudged to have fouled Calvin Zola in the box and was shown a straight red card by the referee.
Niall McGinn levelled but Jordan McGhee's late winner sparked a touchline confrontation that saw Hearts assistant Billy Brown and Aberdeen manager Derek McInnes sent to the stands.
After the game Locke said: "You think you are a bit harshly done by and then you score a winning goal. Anybody that doesn't show a bit of passion, questions would be asked.
"I didn't think Billy did a lot wrong. His momentum took him into their technical area. I didn't think he could move that quickly.
"It's something out of nothing. We will go and have a beer with Derek now and it will be forgotten. The game was action-packed and I think we should be talking about how good a game it was with two teams who were desperate to get three points."