I think it just basically has to do with vulnerability and a resistance to wanting to leave ourselves open to rejection. If we like someone and they know it, then we're more vulnerable to rejection if they don't like us back.

It's hard for folks to put their feelings out in the open and risk not having them reciprocated. So instead they hide those feelings from the person who might be the potential rejector.