For how long have "death and taxes" been accepted as a "certainty"?
The Ngram shows usage of the phrase "death and taxes" from about 1760 and increasingly thereafter, with no sign of its increasing use diminishing in the near future.
The History of Taxation (Wikipedia) states :
Prior to the formation of the United Kingdom in 1707, taxation had been levied in the countries that joined to become the UK. For example, in England, King John introduced an export tax on wool in 1203 and King Edward I introduced taxes on wine in 1275.
The earliest statements regarding "death and taxes" (that I have yet found) are recorded in Wikipedia :-
"'Tis impossible to be sure of any thing but Death and Taxes,"
The Cobbler of Preston by Christopher Bullock (1716)
Things as certain as death and taxes, can be more firmly believ'd.
Daniel Defoe, The Political History of the Devil, 1726.
Our new Constitution is now established, and has an appearance that promises permanency; but in this world nothing can be said to be certain, except death and taxes.
Benjamin Franklin, in a letter to Jean-Baptiste Leroy, 1789
Here is a simple explanation from Merriam Webster.
Note that this sentence might have foreign origins or influences as well. The sentence:
Nihil morte certius
("nothing is more certain than death") was a Latin topos in medieval times.
It was complemented by:
et nihil incertius hora
"and nothing is more uncertain than the hour"
This usage has to be understood in the Medieval Christian perception of "God's will", as well as a wide range of opportunities to die unexpectedly.
There is surprisingly little material available on it, but a little research revealed that it is the opening sentence of a work of the 4th Century, Saint-Augustine's De contritione cordis (I,1). Here is more information on that work.
The concept existed, of course, in classical Antiquity: see Cicero De senectute XX.74 (Moriendum enim certe est).
Adding taxes in a Modern, more secular era may have been a humorous way to oppose the necessity of both natural law (death) and human law (taxes). In that perspective, it might be be understood either as moral precept ("pay your taxes, it's the law") or an imprecation against the rapacity of the state.
Indeed, we can find a similar opposition between the natural and human planes, in the Italian saying:
Piove, governo ladro.
litterally: "It rains; the government is stealing."
Though there might not be any linguistic connection with the English expression, it is an interesting convergence. In that particular case, there is no doubt about the meaning.