There really isn't a good reason for a principal NOT to be able to search lockers and/or backpacks. I understand that a lot of students would say that it is an invasion of privacy, but lockers are school property and backpacks become property as well once they are brought on campus.
These things are searched for many reasons, but it all comes down to making the school a safe environment. Students who bring weapons, drugs or alcohol know that they are breaking a major rule, so they cannot be shocked if a principal gets word of this and looks for these items. They shouldn't be bringing these items on campus to begin with.