It's difficult to tell without any context, but "why" here seems to be an exclamation word that adds emphasis to your answer. It is not the usual question-word "why". Examples of use: "Why, that's absurd!" or "Why, yes!"
And "I ought to" means "I should".