The story
Fasten is fast with a verb ending. Old English fæstnian, "to secure, fasten", was built on fæst — the fast that means "firmly fixed", as in hold fast, stuck fast and steadfast. In Middle English it was fastenen. The T of fast was pronounced in the verb, as it still is in fast.
Around the 17th century, English speakers simplified clusters like s-t before a final syllabic N or L, dropping the T. The same change made the T silent in listen, castle and whistle, and the same pattern shows up in glisten and soften.
The spelling had already been fixed, so fasten kept its T, which makes the link to fast easy to see on the page and impossible to hear.
