Anyway, clearer example: wall paint is a paint, not a wall.
It is always this grammatical structure in German. Consider the alternative: weighing the "weight" of the parts of a compound word to figure out the grammatical gender. Lots of rules and exceptions! As it is, there is one very simple rule with AFAIK no exceptions.
German is difficult for sure, but the gender of compound words is a bad example to prove that.