Well, first off, even when it's just guys chilling you have to take care of yourselves. True, it was an illegal search, but how do you know someone didn't file a complaint?
The biggest thing you forgot to do was lock the door or have someone work the door, even if there are only 11-15 people there. Why was the front door unlocked?
Even when you have those small get togethers, you still have to think about those kinds of things, especially if there is underage drinking going on. If everyone is cool and no one bolts for the door, usually things will be ok. I'm 21 anyway so when a party I'm at gets busted, I just sit there, and sometimes even offer the officers a beer.