The taste that we perceive is a combination of smell and the taste. If we cannot smell, the taste will not be sensed properly. Since medicines don't taste good, people don't want to know the taste of it. So, if the nose is closed, the taste of the medicine will be masked.