Eyebrows were raised when Tykes boss Andy Ritchie - earlier sent to the stands after showing dissent to the referee - Paul Armstrong - had brought off top scorer Paul Hayes and left Richards on the pitch.
But Richards turned up trumps with the vital breakthrough goal in the 78th minute. Man of the match Stephen McPhail began the move with a fine ball out wide to Martin Devaney and when his cross came in from the right, Richards somehow managed to hook the ball over his shoulder from close to the byline and the ball arrowed past Dons keeper Ricardo Batista.
It was a fine finish from a player who has under-performed for Barnsley this season. A minute later Barnsley made sure of the spoils when a right-wing corner was only half-cleared and full-back Bobby Hassell fired home a ferocious right-foot volley.
The closest that the bottom of the table Dons came to scoring was four minutes from time when substitute Aaron Wilbraham was thwarted by a remarkable double save by Barnsley's Republic of Ireland keeper Nick Colgan.
Until Richards' goal both sides had cancelled each other out with some strong performances in defence.
Barnsley held the upper hand in midfield with McPhail constantly probing but they looked short of attacking ideas. The home side should have had a penalty in the 25th minute when Dons defender Dave Partridge clearly handled under pressure from Richards but someone referee Armstrong gave a foul the other way.
That was just one of several strange decisions that lead to Ritchie losing his cool and throwing the ball down in disgust and for that piece of dissent he was ordered to leave the dug-out.
After 63 minutes the otherwise impressive Colgan made a mistake that almost proved costly. He received a back-pass from his skipper Paul Reid but spent too long pondering his options and was robbed by Clive Platt but the big Dons frontman saw his goalbound shot blocked by the covering Neil Austin.