How’s that any different than the US? States determine what they can do.
Cannabis is federally illegal in the US, and the federation has its own enforcement teams that can come and get you even if your state's enforcement teams won't.
Still, EU is a loose federation with some common laws and mostly common border policy. It doesn't even have common currency.
Cannabis is federally illegal in the US, and the federation has its own enforcement teams that can come and get you even if your state's enforcement teams won't.