SIM locks are "built" by the phone manufacturers though aren't they, not actually written by the carriers themselves. So it would have to be Apple, Samsung or Google that would have a claim of copyright if that piece of code is considered a literary work. For example it is Apple wrote that code present in the iPhone, not AT&T thus AT&T has no copyright claim on that SIM lock code.