It doesn't have to be a conscious decision or purposeful design to be "there for a reason". Evolution tends toward solutions because the population that happens to be closer to a solution are more likely to survive. Nothing the op said was incompatible with evolution.
In addition to that, it's certainly not a 'glitch'. A genetic glitch would be a (possibly short-lived) mutation which is still in the 'beta' phase, so to speak, or else a harmful side effect of an otherwise beneficial mutation (e.g. albinism). This is a paradigmatic example of an ordinary useful mutation which persisted because it increased fitness.
Evolution doesn't have "reasons" (pre hoc is random mutation) but it has "justifications" (post hoc is natural selection).