The 25-year-old forward put the hosts ahead at the County Ground on the stroke of half-time, tapping in following a swift counter-attack.
With 20 remaining the Robins doubled their lead as Obika was sent clear by Fabien Robert and calmly slotted home.
Doncaster midfielder Richard Chaplow was then sent off for two yellow cards.
Jon Obika scored twice as Swindon Town defeated relegation-threatened Doncaster Rovers to win their fourth consecutive league game.