The actor explained that his character Kurt will perform the track for his boyfriend Blaine (Darren Criss).
"I have no idea [why it was chosen], but I know it was voted the worst song in history by some group," Colfer told TV Line.
"[The song] was about a rat, but we're singing it about Kurt's boyfriend. I'm not sure what the connection is!"
Colfer also revealed that Kurt's former bully Karofsky (Max Adler) will return before the end of the season, saying: "I love that character. I love that he's kind of like a good guy now."
Meanwhile, Grant Gustin - who joined the show as Sebastian last year and could become a series regular next season - revealed that his character will no longer have a crush on Blaine.
"It's actually going less in a flirtatious direction [between Blaine and Sebastian] and more of [Sebastian] just being a d**k," he joked. "I'm not necessarily trying to split up [Kurt and Blaine]."
Colfer, Lea Michele and Cory Monteith have all confirmed that they will be returning for Glee's fourth season, despite the fact that their characters are graduating.
Glee returns with a new episode on January 17 at 8/7c on Fox.