Being qualified doesn’t automatically make you the best qualified or the best fit. Maybe, the ones in charge of filling the job felt you wouldn’t be good in the role for secondary reasons beyond your qualifications. For example, maybe they felt that an overabundance of hubris would hinder job performance despite having passed some basic skills test or some college degree.