Maybe you didn't impress them so they picked out someone else who did. It could have been they thought you would not be a good fit at the job or you didn't have enough experience . Interviewers go by their feelings sometimes and maybe they thought you wouldn't fit in with the people already working there. Being interviewed for a job does not guarantee you the job as you just found out. Kind of think back on your interview and work on your weak points for your next interview.
Happens to all of us Hun, all perfectly normal. Don't worry about it.
have something that others may not have like BSL/ASL or use a skill that is unusual like karate or fund raising for money and whenever you go for interview, always be yourself, fake your confidence and be polite. Also think of questions they may ask and have your answers ready like what's your weakness and strengths, what should I employ you, you know cover all your ba<x>ses. Hope all this helps. I have problems getting jobs myself too and it's annoying when others gets them so I know I do get you! lol
You must remember that there are lots of people chasing few jobs. Don't get despondent.
Tests generally are the "minimum standard" you need to achieve to work in that organisation. Just passing the test frequently isn't enough - because there's a lot of competition out there and you want to shine and impress.
Happens to me, all the time. -_-
There are some great books out there on interviewing... and even on-line. If you'll do some homework there, you'll recognize the error of your ways and learn what to say/do and what not to say/do. But sometimes? There's just a better candidate ahead of you.