Combination of tradition and practicality.
Sailors often have some bit of ship's work in hand. Dropping it to salute could have bad results. 2nd, tradition is to never salute when uncovered (not wearing a uniform hat), and never salute under a deck (inside any part of the ship). In the US Navy...