Why do we say " for good" to mean "permanently". We often mean the opposite of "good" in any other sense e.g : " My friend has gone for good" .tells the hearer that we regret the passing,. not that we are pleased about it. or see "good" in it
I've always assumed it was a contracted version of "gone for good or ill" i.e. whether the passing was a good or a bad thing the fact was that it definitely was gone.
It originated in the 1500s as 'for good and all' rather than good and ill. Thereafter, it was even sometimes hyphenated as 'good-and-all'. I suppose the use of two words was seen as a means of emphasising the utter finality of whatever was being spoken of. Rather in the manner of rhyming slang, the key word then disappeared!