The "pun" is that $F^D$ denotes a set, with no actual notion of "powers" as in two-to-the-tenth-power is 1024. But it happens that when you compute the cardinality of that set, it's actually $|F|^{|D|}$, which is something that does have to do with powers. The the "pun" is in the two different-but-related uses of the single notation "something-superscript-something-else".
If you look at Halmos's book on Naive Set Theory, you can see this "pun" extended further, in the sense that the number "2" in that book is defined to be the set containing $0$ and $1$, so $|2^F| = 2^{|F|}$, where the two $2$s represent slightly different things.
Note: from one dictionary: "pun: a joke exploiting the different possible meanings of a word or the fact that there are words that sound alike but have different meanings." In this case the "word" is a notation, and the notations look alike rather than sounding alike. So maybe it's a meta-pun.
Not all puns are funny; much of John Donne's poetry is a testament to this.