This happened to me and many others at my school as well. Universities are often required, either by internal rules or external laws, to accept a certain distribution of students with less bearing on academic abilities.
At my school, we also had an awards and acknowledgment night for all the scholarships that our graduating classmates were going to receive. I knew that it was going to be competitive to receive a scholarship, but I thought I had a decent chance to get at least one of the many available when considering my accomplishments. I did apply and I was in the "cream of the crop" as the teachers called us.
As each award was announced to the audience, my thoughts began to grow from minor surprise, then to disbelief, and then to anger. After all the scholarships had been awarded and the recipients were on stage, it became very obvious that the awards were chosen mostly with a demographics bias, and actual aptitude or scholarly performance had little merit. There were only a few males out of about 25 people on stage, for example. I think maybe 2 of the students were actually in the AP/honors program. My immediate thought sitting in the audience was "really? Why do all of these people who had it easy, with easy classes, get awarded so well for being mediocre?" They were not bad students by any means, but they also were not the over-achieving kind that you would expect to receive the scholarships.
Being told that you needed to enroll in all of the hardest courses, participate in as many sports and extra curricular activities as possible, and show community service and responsible behavior for years is a lot of stress and hard work, and you expect it to pay off. Seeing all of my effort to go to college being brushed aside for others because of reasons out of my control really left me frustrated and angry too, so I know how you must feel.
It is a good lesson for a young person though. What people tell you or what expectations you may foster are not necessarily guaranteed, and sometimes are far from reality. Feeling entitled and then being denied is humbling, and it is usually good to be a little humble at times. You should not compare yourself to your friend, because if it wasn't your friend being accepted to the college, it would be a stranger getting that spot for the same reason instead of you still. In that perspective, you could even feel happy for your friend. If you are really that deserving to go to college and you have what it takes, you will end up successful anyway. Big and prestigious universities are not as important as you may be lead to believe, especially as an undergrad. Few of the admitting universities have obligations to let you in, and it is a fact that some people need much more help financially and socioeconomically than others to reach their potential. This was something out of your control, and so you should try to feel good that you're going to a good college still, even if it isn't your dream college. My personal opinion is that the policies are overboard and unrealistic now, but that is not something easy to change.