Where thirteen is treated positively, it is usually because a calendar put it there.
A solar year contains twelve lunations with eleven days to spare, so roughly every third year a lunisolar calendar needs a thirteenth month. That intercalated month is the practical origin of much of thirteen's association with disruption and with the moon; it is the month that does not belong.
The strongest positive tradition is Mesoamerican. The 260-day ritual count, the tzolk'in of the Maya and the tonalpohualli of the Aztec, pairs a cycle of thirteen numbers with a cycle of twenty named days, and 13 x 20 = 260 gives the period. The thirteen-day unit, the trecena, is the working week of that calendar, each with its own patron deity and character, and divinatory almanacs are organised by it. Maya cosmology also gives thirteen levels to the upper world against nine to the underworld. None of this carries any suggestion of misfortune; thirteen there is a structural number on a level with twelve elsewhere.
Where the 260-day count itself comes from is genuinely unresolved. Proposals include the human gestation period, the interval between zenith passages of the sun at certain Mesoamerican latitudes, and the cycle of Venus, and none has become consensus. The 260-day period fits together with the 365-day year to give the fifty-two year Calendar Round, and that much is arithmetic rather than interpretation.
Elsewhere thirteen is thin. Its appearance in the American seal, thirteen stripes, thirteen stars, thirteen arrows, counts the founding states and nothing more, though it has attracted a large and entirely modern conspiratorial literature.