It appears he did have a CW permit, but possibly for another close by county
Castile had a CCW permit good for the entire state of MN. But in MN, CCW permits are issued by the county sheriff.
Castile lived in Hennepin County (think Minneapolis, although he actually lived in Robbinsdale) in the past. But, the shooting occurred in Ramsey County (think St. Paul, although it was actually Falcon Heights).