This phrase seems to come up quite regularly in pre-WWI historical texts in which ambassadors would "ask for his passports" and leave their post before hostilities commence.
The only thing I could find that touches on this phrase is this Foreign Affairs article which states the obvious that there were no physical passports to be handed over, but did not bother to explain the meaning of the words anyway. So, what is the true origin of this piece of diplomatic language?
i'm not sure but going over to the oed suggests this might be due to an older definition of passports:
†2. Authorization to leave a port or to enter, leave, or pass through a country. Obs.
or definition 63
c. Permission to pass or go somewhere; (fig.) release or dispatch from this world; †a dismissal (obs.).
1579 Spenser Shepheardes Cal. Epil. f. 52, Goe lyttle Calender, thou hast a free passeporte. c1595 Countess of Pembroke Psalme lxxii. 60 in Coll. Wks. (1998) II. 91 With out his praise No nights, no daies, Shall pasport haue to go. a1603 in T. Wright & J. O. Halliwell Reliquæ Antiquæ I. 250 Kepe hym as longe as he cann lyve, And at hys ende hys paseport geve. 1631 J. Mabbe tr. F. de Rojas Spanish Bawd xviii. 182, I will give him his passe~port, I warrant you, unlesse hee betake him to his heeles, and runne away from me. 1691 J. Wilson Belphegor v. iii, I made his passport for t'other world about four years since. 1833 E. Bulwer-Lytton Godolphin I. iii. 26 Give me free passport, hereafter to come and go as I list. 1878 R. B. Smith Carthage 47 The Phoenicians, true to their general policy..to trade with those countries only where trade was its own passport and its own security. 1901 M. Morgan Echoes from Solitudes 95 Thou need'st no passport for the tomb. 1987 J. Broughton Sorrows of Befuddlement in Packing up for Paradise (1997) 33 Stamp me a passport to some lucid purgatory.
it strikes me 6c is the more likely obviously correct answer. The 1603 quote suggests the exact meaning you are talking about which is being asked to be dismissed from his post.
while this doesn't give a why or true origins i hope you find this helpful (the oed is an amazing source if you have access to it)