Setting
Aloha, Schofield Barracks
It's easy to forget that, when the Pearl Harbor attack happened on December 7, 1941, Hawaii wasn't actually a state—it was a territory, like Puerto Rico, Guam, and the U.S. Virgin Islands still are today. So everyone in this movie is hanging out in a U.S. territory, one geared around its military base, during the months prior to Pearl Harbor, waiting for the hammer to fall, even though they don't necessarily realize it's going to fall. (To be specific, the action is set at Schofield Barracks, part of the army's base.)
The setting itself adds tension, since, presumably, we know that Pearl Harbor isn't so far in the future. It also adds irony, since we can surmise that this boxing tournament that Prewitt doesn't want to join isn't going to happen anyway. The war is going to intervene, making all the suffering Prewitt undergoes at the hands of his comrades all the more pointless.
James Jones, author of the novel From Here to Eternity, was himself stationed on Hawaii—specifically, in Honolulu on Oahu. So the movie's depiction of life in the service on Oahu has personal accuracy. When Jones shows the soldiers hanging out and carousing in different places—like the bar Choy's and the not-really-a-brothel New Congress Club—we can assume that he's drawing on his own experiences of how they killed time.
The Brothel That Wasn't
The New Congress Club is a particularly unusual setting, since in the book itself, it really is a brothel. In the movie they're not able to say that, because of the censorship of the time. This makes its status sort of ambiguous. It's a place for the soldiers to hang out at and be entertained by "hostesses"—women who might or might not be prostitutes. This setting is sort of confusing for that reason.
But it's Schofield Barracks itself that shapes action and character the most. Naturally, almost everyone there is a soldier. And the ways they interact are all structured by military rules and regulations. When the officers higher up the hierarchy—like Captain Holmes—abuse that structure and take advantage of it, it creates something that actually goes against military order, transforming it into a gangster-ish fiefdom. Military drills and training become a form of persecution for Prewitt instead of a form of discipline. But fortunately, by the end of the movie, the structure manages to clean itself out, with Prewitt's superiors punishing him and forcing him to resign.