Sorry you got busted, if he was truly just being a jerk as you indicate he sounds like a real winner who will make lots of friends But, let's reconsider this: Illegal is a pretty strong and relatively meaningless word. Perhaps against University rules, but the R.D. is not a police officer and they don't have to worry about throwing out evidence they gained through questionable or even outright illicit ways because the University is not a court of law. In fact, while in the dorms you are on their property, and they can do all sorts of things which they tell you they won't do. While he sounds like a real turd sandwich, you don't get afforded the protections a citizen gets from the government, even if it's a local or state school.
Not trying to reprimand you, but warn you for the future. Lots of college-aged people think they can get by on technicalities or say, "You can't do that," but the bottom line is most of the time they can, and when they can't you usually don't have much in the way of legal recourse. Watch your bottom, because it can be real easy to get in big trouble these days, and there are enough jerks in R.D. and administration positions to make it a real pain.