Magic was a mystery and the author uses Willian's belief as an event to explain this mystery and the power that magic can provide. This caused William to move away from concepts related to magic and as he moved away from it, he approached the study of science, which he found exciting and beneficial.
The error that makes the sentence wrong is the word of "Although." It makes the sentence like a fragment. It looks like it need another clause to make it a complete one.