Ian Baraclough's hosts had nothing to show for enjoying the better of the opening 45 minutes in the Scottish Premiership clash but put their rivals to the sword after half-time.
Ainsworth fired home a sensational long-range strike in the 49th minute and doubled his tally a minute later.
Hamilton's evening continued to unravel as Darren Lyon was sent off for an ugly lunge on Marvin Johnson before Ainsworth turned provider for substitute John Sutton to head home.
Sutton completed the scoring from the penalty spot seven minutes from time when Ziggy Gordon clumsily brought down Lee Erwin.
Motherwell now sit four points clear of bottom club St Mirren, while fifth-placed Hamilton's winless run now stands at 11 games.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.