Why do unboiled eggs last longer than boiled eggs?
An eggshell is a complex structure.  From Wikipedia:


Boiling the egg removes the waxy cuticle from the outside of the egg, dissolves a small but not insignificant amount of calcium carbonate from the shell, damages the protein matrix that holds calcium carbonate crystals in place in the shell, and can disrupt or destroy the two shell membranes.  All of these contribute to allowing bacteria a means to enter the egg and spoil it.

Note: Though calcium carbonate is actually less soluble in hot water vs cold, the rate of dissolution is substantially greater.  Unless the egg is boiled in a saturated solution of calcium carbonate, it will lose material to the solution when boiled, and any pores in the shell become enlarged as a result.