In the world of private business, you can be required to surrender one's driver's license for a period of time if security feels that the circumstances warrant such in order to do a background check on a particular person as a condition of remaining upon the premises. This seems to be what happened to you.You had the option to remain and give up your driver's license, or refuse and be asked to leave the premises.