The thought process here is evident, even if it's patently indefensible. If Dan Quinn trusted the defense to stop Blaine Gabbert, as they had several times during the day, putting the game in their hands with two timeouts was a decision he probably did feel comfortable making. It ultimately backfired, with Gabbert scrambling for the first on third down and four, and the Falcons losing inarguably their worst game of the season by a score of 17-16. Quinn did, at least, address it.
Why was it a bad call? Because the Falcons were on the two yard line, where they had a decent chance of scoring, and failure meant the 49ers offense would be stuck near the goal line, which puts added pressure on a very mediocre unit. Their chances of forcing a stop was the same or better than it was after the field goal, and their chances of winning certainly weren't significantly worse than they were after the field goal.
What this really says is that Dan Quinn did not trust the offense to turn a short field into a touchdown with little time remaining, and he would rather give them a shot at a field goal and trust the defense to shut things down and give them the chance for the game winner from Matt Bryant. That's not a ringing endorsement for the offense, and it makes clear that Kyle Shanahan and Matt Ryan have got a lot of work ahead.