John Updike wrote "A &P" in 1962 and it reflects the beliefs of the New England ocean town where the story takes place at the time. The adults of the time would certainly have agreed with Lengel, the manager, and as the store's proprietor, he certainly is within his rights to ask the girls not to come in dressed in a certain manner--likely, it was as scandalous to come come in a grocery store wearing a bathing suit at that time as it would be to go into a store wearing a thong bottom bathing suit today. That may sound ridiculous, but I believe it is an adequate comparison.
Sammy feels completely justified, but he soon learns that the girls do not herald him as their hero; in fact, they don't even acknowledge him. This is a "coming of age" story in which Sammy learns a lesson. The lesson is multi-faceted and as readers we may have trouble putting our finger on it- but he realizes that deeds are not always noticed and his grandiose gesture has hurt only himself. Still, we can hope he is not dissuaded to think that standing up for strongly held beliefs is not wrong; he simply has to pick which beliefs are worth fighting for a bit more carefully.