I used to get ear infections somewhat frequently when wearing ear muffs all the time.
I think it would probably be the same problem if you wore a beanie all the time, especially if you had your ears tucked in.
Probably best to play it safe and dispose of the beanie.