I don't need to do the work
Here, we can see that need is the main verb of this sentence. But when I turn it to a passive then need works like a modal and do has became main verb.
The work doesn't need to be done by me
It's the same, the main verb doesn't change, only changes its conjugation and the verb complement. There's no modal verb in any sentence, too.
In both sentences "need" is the main verb. "Don't and doesn't" only are auxiliary verbs which they form the negative sentence. "to do" and "to be done" are verb complements.