Different species of microbes have evolved to reside in different parts of the body. This selection is partly connected to their point of entry. Depending on their entry route, the target organ is decided in the host. For instance, if the microbes enter from air via nose, their target organ is the lungs (e.g. - Tuberculosis causing bacterium) If the microbes enter through the mouth, they attack the gut lining like the typhoid causing bacterium.
But remember that this is not always the case. For example - The HIV virus enters the body through the sexual organs, but spreads to lymph nodes all over the body. Here the entry route of the microbe does not correlate with their target organ.