What can I do you for? = What crime can I arrest you for? What can a book you for? What can I arrest you for? etc.
Ex: He was done for speeding. He was done for robbery. He was done (punished) for not doing his homework.
The line is used a a humorous remark because of it's similarity to "What can I do for you?" Yes, you'll hear it a lot in American movies.