According to the wiki Tuberculosis
in its "latent form" is not transmissible. Having lived among peasants in rural Botswana, drank goat and cow milk practically from the teet it was pretty much invevitable that I'd be exposed to it. Apparently the ungulate herds of Africa and possibly other populations are a major animal reservoir for the disease where it can be endemic but causes virtually no symptoms (a bit like how populations of foxes in Europe are the primary reservoir for rabies). I would imagine that quite a few of our returning service personnel from Afghanistan and Iraq have been exposed and test positive for the latent form after they return as well; though perhaps the risk for a soldier is lower than for an ethnographer!
Anyway . . . that wiki is saying that the latent form is not a transmission risk, though I seem to recall that, once one has contracted it, it may never "go away" (meaning one may always test positive and be at some risk for the infection to flare into symptomatic form, at which point the victim IS a transmission risk). I'm not sure though, and in truth, immunology and infectious disease are full of strange exceptions. I seem to recall one of my more recent physicians telling me there was no point in testing me any longer because it had been so long since exposure without symptoms (10+ years at that point) that my latent infection might be so diffuse as to be below the detection threshold for the measurement. Not sure if that is accurate or not.
All this to say: being a carrier of latent TB and being a repatriating national probably should never be grounds to be excluded from re-entry. Soldiers, anthropologists, journalists, film makers, documentarians, third-world groupies, trekkers, human rights NGOs, etc., etc., are all job roles where the chance of exposure from an overseas trip are non-trivial, with third-world groupies and anthropologists probably being at the highest risk (given both groups tendency to live in very close proximity to local populations). Nonetheless, it is worth noting that, should anyone with latent TB suffer some other ailment which compromised their generalized immune system or metabolic processes which allowed the latent TB to multiply, I believe any latent carrier is (at least for some period of time after initial exposure) a risk to become a transmitter of the disease; so people like me should be cognizant and responsible.
When it comes to foreign aliens seeking entrance, then there are two cases to consider: (a) individuals who are symptomatic with TB (and for that matter ANY disease) and who are not specifically seeking entrance for the limited purpose of paying to receive medical treatment (U.S. gets several thousand health migrants every year who come for cutting edge therapy for things like cancer and cardiovascular disease) should at best, have consideration of their entrance delayed until such time as they can be deemed to have clear health [I was subjected to this sort of scrutiny as a condition for being given a visa to live in Botswana and, apart from nations which have very close relationships with the U.S. like the U.K., I would expect that any stamp of more than 24 hours would similarly require a "clean bill of health"]; (b) foreign aliens who are latent for TB is a more difficult call, given that they could pose a risk to be symptomatic in future.