Did you tell her that you liked her? Either way, with situations like this, you maybe didn't show enough interest in her so another guy showed more interest and asked for her number. It happens. What I've learned is that waiting too long to ask a girl out is the worst thing you can do because sooner or later she's going to get other offers. It's a numbers game. If you want something, you have to act quickly.
_________________
"The less I know about other people's affairs, the happier I am. I'm not interested in caring about people. I once worked with a guy for three years and never learned his name. The best friend I ever had. We still never talk sometimes."