Why is it not a risk factor but a risk factor?

This is because nouns are used as attributive grammatical rules. Very common. You can keep it.

Other attributives of similar nouns include: street lamp. (Street lamp), evening school, China Daily (China Daily), etc.

Very common usage in English.