It means, when you always (try to) do the right thing, some (few) people who also believe in doing the right thing will be pleased with you, while the rest (most people), who don't believe in doing right, will be surprised by you. (And may criticize you, for doing something they didn't consider worth the effort, etc...)