This type of harassment is right in line with my posting 'Roadblocks and routine license checks" (see Mississippi stories). Obviously the LEO's need more training on the issue. Apparantly, even though most states have adopted some type of CC or OC laws, the message isn't getting down to the local officials.
Outside of the "I have a badge and you don't so you shouldn't have a gun" mentality that some officers obviously have, I believe most of them welcome the idea of LAW ABIDING citizens carrying guns for self defense.
I think you and your friend acted responsibly by not losing your patience with them because that might have led to some other charge theycould have come up with to detain you even further.
All in all, I think it is up to us to get involved by going to our local police, sherrif, highway patrol and town hall meetings to get answers from our officials about their knowledge of gun laws and what they are doing to to keep events like yours and mine from ocurring in the future.