And the reason is because when you are looking for a job other things are more important than knowing the salary even before you apply or they seriously consider you.
Everyone does whatever they can get away with, and the moment we accept that everything becomes clear. They are all trying to benefit themselves, just as you are by trying to learn some information before the other party feel the need to share it with you.