While it's difficult to understand exactly what happened or what the motivation might have been, the town that was attacked is an important location as it provides access to the entire Idlib province. It's also quite possible that Assad is buoyed by the inaction so far against him, and felt that he could strike in all impunity. Finally, he also, like his father before him, has a predilection for not just winning a battle, trying to completely obliterate his enemies to send a message. The term "Hama Rules", coined by Friedman some years ago, captured that sentiment.
Point is I really wouldn't put it past him to have launched the attack in his view of the state of the war and the world, that we may not fully understand, and he probably did not expect a US attack given the relationship of Trump with Putin and the many statements Trump had made about intervening in Syria previously. That being said, I would also be cautious in jumping to conclusions, but there seems to be little evidence of an alternative scenario at this point.
What role the US will now play, with Nikki Haley now insisting on regime changes, and how that will all play out, will undoubtedly not help the short-term situation of the civilians still in Syria.