The correct answer is Option D.
PRETEXT means A REASON GIVEN IN JUSTIFICATION OF AN ACTION THAT IS NOT THE REAL REASON.
The person in the given sentence begs leave of the king on the PRETEXT that he had to attend to his ill wife. This means that his wife being ill is not the real reason that he is leaving the king. The reason is something different but he makes up the story of his wife's illness to beg leave of the king.
Thus Option D is the correct answer.
The remaining options are incorrect because:
Option A: OFFER means to ask someone if they would like to have or take something.
Option B: EXCUSE has the same meaning as pretext but it is more informal.
Option C: PARDON means to forgive someone and free him from the punishment of a crime.