Well, Atticus was very intuitive to begin with, but here are some reasons why he knew all along:
1. Jem tried to lie when asked where his pants were. Dill tried to say that he lost them while playing strip poker, but cards were frowned upon in Maycomb.
2. The pants came back poorly mended, meaning Calpurnia wasn't the one who mended them.
These are just some of the reasons that led Atticus to that realization.