No, Sonic and Shadow aren't twins. Shadow is actually a bio-engineered lifeform created using alien technology and DNA—which is part of what makes his origins so mysterious.
As for why Shadow was designed to take the form of a hedgehog, that's never fully explained, but Sonic is, quite simply, just a hedgehog. Despite their similar appearance, the two have very different backgrounds.