no, you are not wrong for taking the computer away. Boundaries are good. If he doesn't do his work, he doesn't get time on the computer. My suuggestion to you is this, however; Set the rule ahead of time. Let him know, during a quiet time, that if he does what he needs to accomplish, he will be allowed a certain time on the computer. If he doesn't get it done, he doesn't get computer time. Remind him when he gets home from school.
When he does get computer time, set a time limit. Set the timer and remind him 10 or so many minutes before then again at two minutes.