You have to spar at a MUCH MUCH slower pace until you can get the hang of it. It takes time for your body, defensive awareness, reflexes, and eyes to be able to see the punch and prepare your body to absorb the impact intelligently. Some people are more naturally able to absorb punches than others.

If you feel like you're always getting "surprised" by punches, you must slow the pace down and give yourself some time to get accustomed to it. It's that simple. The most basic thing I can tell you is that it's all in the eyes. You need to train your eyes to the punches coming. Keep slowing down the pace until you see every detail of every punch. This might mean slow motion but you will improve greatly from it. Good luck!