
The notion appears to have been that, by declining to spend a penny and to save one’s money instead, you are a penny up rather than a penny down, hence ‘twice got’.
The original form of this proverb used ‘got’ or ‘gained’ instead of ‘earned’. That is recorded as early as the 17th century, in George Herbert’s Outlandish Proverbs, circa 1633: A penny spar’d is twice got.