Do not take this personally. Companies make mistakes in the interviewing process and reject great people all the time. I have seen some absolutely amazing programmers with the chops to work anywhere look for jobs. There is always at least one company that rejects them. It's their loss.
Do not assume that you did something wrong. The mistake could be on their part. You made it through all of those technical interviews, so you will be able to find work somewhere!