I think body odor has an evolutionary reason to exist, and that reason applies to prehistoric humans living in small gather hunterer societies of <150 people only. Whatever that reason was, is not necessary for our survival in modern society where you meet thousands of people over your lifetime and run into new strangers constantly.
I dont think body odor ever played an evolutionary role. As far as I know body odor is caused by bacterias eating and multiplying whenever we sweat. If this is the case body odor is here because we sweat which isnt that common within the animal kingdom.
(Although dont quote me on any of this, this is just what I seem to remember and Im lazy to look it up - tldr i might be lying)
I'm absolutely not an anthropologist, but if we evolved in small <100 person communities, often settling near water, I'd imagine keeping everyone relatively stank-free wouldn't have been impossible.