From reading the text, we can can infer that Scout wasn't surprised that her father was defending Tom Robinson, but rather surprised that he was appointed as Tom's lawyer. Scout learns this while listening to the gossip of the Idler's' Club in Chapter 16.
"Lemme tell you somethin‘ now, Billy," a third said, "you know the court appointed him to defend this nigger."
"Yeah, but Atticus aims to defend him. That’s what I don’t like about it."
This was news, news that put a different light on things: Atticus had to, whether he wanted to or not. I thought it odd that he hadn’t said anything to us about it— we could have used it many times in defending him and ourselves. He had to, that’s why he was doing it, equaled fewer fights and less fussing. But did that explain the town’s attitude? The court appointed Atticus to defend him. Atticus aimed to defend him. That’s what they didn’t like about it. It was confusing.