The correct option is B As a mark of respect to their superiors
Since Medieval Times, taking off your hat has been a sign of respect. Therefore, the British officials pull off their hats when they pass an officer, or to speak to them to admire or respect them.