Why do some cargo aircraft have windows?
Some cargo aircraft do have limited seating, as mentioned in the comments it could be for the relief crew, load officer, or other employees making a hop on the plane. Here is a nice blog post about  flying in a cargo plane. This article covers it pretty well also. 


(source)

Some cargo planes are also old passenger planes and some of the windows may be left in place.