Don't assume it's your fault.
Hiring, often times has biases. There could be any number of reasons: either technical or personal. Hiring decisions are often subjective, despite the fact that they try to be somewhat objective. And it's especially hard for people with less than 5 years of experience. Keep trying, you'll get it eventually.