Yes, the school has a legal right to search anything on their property, that includes your computer, car, backpack, locker, etc. If you're using the school's internet, then they have a right to have access to it.
The only way that I can see around that is if you had one of those internet plug ins for your computer. I'm not entirely sure what they're called, but you probably have at least heard of them before. Even that's a maybe though.
Now, if they go onto your account and search through it...I think that still falls under the same principle. I know that if you friend a teacher on fb, and they see "huge party this weekend at bob's house, lots of boose" they're obligated to report it. I don't see how the school messing around with it is really all that different.
I think that this is one of those instances where the law hasn't quite caught up with the tech, but they can always say, "We're monitoring for cheating, illegal activity, etc." and since they're not cops, the "in plain sight" rule doesn't apply, or I'm fairly certain that it doesn't. My friend's dad is a criminal defense attorney, I can ask him and see what he says. I'll get back you you on that.