Something that hasn't been explicitly mentioned is that the word "clothes" is like the words "pants", "glasses", "binoculars", or "scissors" in that they are plural-only nouns. The plural of "cloth" is not "clothes" but "cloths". "Clothes" has no singular.
I think this partially explains why most compounds and attributive nouns use the singular form of the first word (even for semantically plural things, like "ten-foot pole"), but "clothespin" uses the plural form. However, it's more complicated than this because some of these plural-only nouns do get used in a singular form. Both "binocular case" and "binoculars case" are used.
So for some plural-only words, both the singular and plural forms get used in attributive nouns. However, I think that "clothespin" is rather like "glasses case" in that using a singular form would be ambiguous. A "glass case" would be interpreted as a case made of glass (the material) or (less likely) a case for holding glass rather than a case for holding glasses. "Clothpin" has the same issue.