Sonic Team Producer Tetsu Katano is the man to blame if you're not happy with Sonic and the Black Knight. It was his idea to slap a sword in the hands of a hedgehog.
...after a sequence of sleepless nights that my boss came up to me and casually dropped on me the newss [sic]that it would be up to me to think of an idea for "the next one (in the Storybook series)".
After much struggle that gave me both pain and joy, I finally decided to throw Sonic into a world of sword and magic. I confess that I've always wanted to see Sonic holding a sword.
Black Knight has our hackneyed hero hurtling through the realm of King Arthur, hacking and slashing while still trying to grab every gold ring between him and the finish line. Critics aren't liking the sword mechanics, mostly on account of the waggle-prone motion controls, but also because it just doesn't make sense for Sonic to have a sword.
Katano is aware of that — but it didn't stop him from making it the main part of the game:
Perhaps most challenging was to make Sonic have a sword. I had to hold on to the Sonicness. If he loses that as a result of having sword, then it would be preposterous.
To be fair, I think Sonic lost his "Sonicness" long ago. Like when he made out with a human. If bestiality isn't preposterous, I don't know what is.
Sonic and the Black Knight - The Producer Speaks! [Sega America Blog]