The ashtray may have been a gift from before the smoking ban, or it may have been a 'gift' once the smoking ban went into effect. It isn't like the character is shown smoking, or even hinted at that he smokes. It is a relic of his time spent on a submarine, not in active use.