Maybe he has reading issues. I say this because my daughter has been struggling in class, not doing schoolwork, yet when she is at home and I read the questions to her, or I sit her to read out loud and correct her mispronunciations, she does the homework flawlessly. She also needs discipline and attention, obviously. Her new aftercare teacher sat her down and had her read her math problems and realized the reason she could not understand the questions was because she was not reading them properly. Once the teacher read them to her and told her to break down the numbers into flowers to figure out how many tens and ones there were, my daughter got the problems right, and it made it fun.
She, and your son, are still too young to be trusted to work independently, like Jennifer says. Plus, it's easy for kids to get distracted and talk to other kids, and find schoolwork boring. Maybe your son is bored, or not stimulated enough, maybe he is too smart for what is being taught.
Teachers these days are not creative, and make no effort to make school fun, or to provide feedback to parents. This is something I hear from other parents, including those who run aftercares, and stay-at-home parents. My daughter's grandfather is able to get her attention because he used to be a teacher and knows how to make things hands-on and fun, something he admits today's teachers lack, either due to time, budget cuts, lack of creativity, or school overcrowding.
We are going to work on my daughter's reading, and offer a better reward system than what they have at school, a system which will offer her a small reward like a sticker if she answers most questions correctly and makes an effort, rather than rewarding her only if she gets them all correct. If she gets them all correct, then obviously, she will get a bigger reward, like a weekend at the zoo or something else she picks herself. Sometimes, motivation is all it takes. I suggest checking up on his reading, and also, sitting at the table, even if you're doing something else at the same time like proofreading some of his homework, so he doesn't feel all alone and feels like he's being watched and expected to do his very best. Reward any independent and positive signs of progress in a small manner and make it clear the better he does, the better the reward.