Deviate is not a transitive verb, so you can only say you deviated from the main story, not that you were deviated from it. But in fact a better expression would be that you “got sidetracked” by the subplot.
"Deviating from my original purpose" suggests that I deviated (was deviating) which would be an action.
"I was interested in the side story." is a state not an action.
I deviated from my original purpose because I was interested in the side story.
Deviating from my original purpose, I became very interested in the side story.