STOCKHOLM—One of the masterminds behind the file-sharing website The Pirate Bay Wednesday had his prison sentence reduced after a Swedish appellate court said one of the charges lacked sufficient evidence for a guilty verdict.

Gottfrid Svartholm Warg, 28, was sentenced to two years in prison by a Swedish district court in June for his alleged role in hacker attacks. He was found guilty of accessing computers that were hosting several Swedish government agencies' registers, and for hacking into data owned by Nordea AB, a major...