The reason why cats lick people's pants may be out of exploration and attraction to fresh smells. Licking is a common behavior for cats, as they lick to moisturize and protect their paws, as well as to sniff out surrounding scents.
So if your pants have some scent that interests your cat, he might try to lick your pants. In addition, cats may lick people's pants or other items to seek attention and comfort. If your cat often licks your pants or other items, you can try to provide it with games and activities that attract its attention, or provide it with some of its favorite toys on a regular basis to help deal with its restlessness.