Ah, social scripts.
Regarding "the question": One perspective, valid in some cases and not in others, is that they're not actually asking that question. From that perspective, when a stranger asks "How are you?" they're simply communicating "hi"; and "I'm okay" is simply a reciprocation of what the person is really communicating.
Emphasis again: that's simply one perspective of many--it's less 'true' for friends than strangers, less 'true' for direct communicators, etc.
Emphasis again: "I'm okay" is one of many valid answers. Derailing the whole train is also fun