I watched The Distance (S05E11) but I just don't understand why didn't he want to go somewhere where he might get to stay instead of worrying Judith would attract the zombies?
Ideally, Rick did want to go with Aaron - but theirs is not an ideal world. Past experiences have taught Rick and the group to not trust strangers - especially ones who belong to groups - even those promising sanctuary. Consider the major groups that they've come in contact with thus far in the show:
- the nursing home group in Atlanta: not terrible, but they were ready to kill members of Rick's group.
- the Greene family: this worked out ok.
- The prisoners: betrayed and tried to kill them
- Woodbury & the Governor: destroyed the prison, killed Herschel, Axel, responsible for the death of Andrea, tried to kill Glenn. The governor killed many of his own people.
- Tyrese, Sasha, et al: this turned out ok.
- Abraham, Eugene, Rosalita: this has turned out ok aside from Eugene lying to everyone about DC
- Terminus/The Hunters: Killed Bob, wanted to kill/eat the group.
- The Claimers: tried to rape Carl, wanted to kill Rick
- The Hospital Cops: kidnapped & killed Beth
Rick and the group would love to believe that Aaron would take them to a safe zone, but they're wary of anything strangers tell them, and will naturally distrust newcomers until they have proven themselves.