A Needham doctor was arraigned Thursday on nine counts of illegally prescribing controlled substances, Middlesex District Attorney Gerry Leone said.