The presumed original intent of the test was to assess the military risk from a bacteriological attack upon a U.S. city.
You couldn't build an empty mock city and test with it. Humans are a necessary element of biological contagion.
You couldn't get voluntary, informed consent from the inhabitants of an actual city, because behavioral patterns might change in response to the knowledge that the test was being conducted, and a lot of people would refuse to participate. Public knowledge of the test would screw up the test and make the results unreliable.
So there's no way to ethically perform such an experiment. But many soldiers also consider it their ethical imperative to protect the civilian populations of their country as well as they are able. Therefore, the rationale would be that in order to protect the lives of 300 million, the experimenters must trespass upon the rights upon 1 million, in a manner that most of them probably wouldn't even notice.
Of course, those people, having entirely too much trust in the essential goodness of their government, didn't consider that the same data could also be used to make bacteriological attacks on foreign populations more effective. They didn't consider whether their "harmless" bacterium was actually harmless. And they refused to take responsibility for the actual, demonstrable harm to unsuspecting humans.
This is why we have international conventions against certain military activities, and why we should not tolerate such tests to be conducted upon us, or anyone else. It makes no difference whether the humans are the subjects or the test medium, because the purpose of the test was to study biological warfare upon humans. And a biological weapon is one of the few weapons creatable at our current technology level that have the potential to annihilate our entire species. Any data gathered at all in this domain can only serve to make such weapons more effective, and defenses against them more complex. None of us can afford a human-versus-human arms race in this, as the one conducted between us and other species is a difficult enough struggle already.