Well, I don't know what shapes a person's sexual identity. But if you add abuse of any kind to the picture, surely it is a factor but it might factor differently for different people and it could have a wide range of effects.
One more thing I want to say about spanking. If it is effective, then you of course remember not only the spanking but the reason that you were spanked....
(edited to add trigger icon)
.