How can teaching staff improve a passive student group?
Some are busy in coding, some are reading research articles, some are doing something else.
I have seen (and participated in) this exact behaviour in classes that are minor and irrelevant to the study path students take. This might be an Ecology class for Physics majors, or a Science class for Language majors. Thus, step 1 is to understand students' motivations behind taking your class. If your students only take classes because some governing body requires them to, you have little room to improve their motivation.
To find if this is the case, try asking the students: either directly or by collecting an anonymous poll with 'What is your motivation for this course?' question. If the answers indicate that their motivation is external, adapt.
One strategy I can think of is changing the lectures to project work, literally making the students learn on their own. However, what to do with students who only have external motivation is a separate question. EDIT: since the students seem to be taking the class for the sake of a good transcript, they will not interact with you in the lectures. Their goal is to sit through the lecture, "nine-to-five", and minimize the effort, subject to reaching a passing grade. (Ironically, students are good at solving these kinds of optimization problems.) My advice still holds: if a student is given a project to work on, be it a program, a research report, an essay, a survey, you name it, he has much less space to slack than in a lecture.
Some possible strategies:
Make sure the lecture is worth listening to. Don't simply go over what's in the textbook.
Reward the students who pay attention by asking exam questions about examples gone over in lecture.
Put students who obviously aren't paying attention on the spot by asking them questions.
If the class as a whole is doing well on assignments and exams but still appears bored, consider making the material more difficult. (But be careful about this, lest you leave the weaker students in the dust.)
Remind students that they can leave if they don't want to be there. (Being able to say this is one reason I never take attendance.) A classroom with five engaged students is a better environment than a classroom with five engaged students and 35 distracted students.
In my opinion, there has been a general (but not universal!) downward trend in student engagement and participation in classes in recent years. In other words, I see more passivity these days than previously. I'll skip the analysis and get to the brainstorming. (You may have tried some of these ideas already.)
Incorporate a small participation component (no more than 10%) into your grading scheme. (If you do this, (a) make it clear in the syllabus and remind students of this occasionally -- but don't drive it into the ground; and (b) make sure you do it consistently by making notes right after class, and during class if need be.)
For students who are not comfortable participating in a spontaneous way in class, provide alternatives. Examples: online class discussions, asking students to peer review each others' drafts, some "journal" type responses to thought questions. Note that a shy student who doesn't feel comfortable sharing his or her response with the whole class will still be able to participate in this, by sending the response to you individually. Or you could have them participate electronically using a randomly assigned ID. You have to design and test the questions carefully so that it's clear what you're asking, so that there is no one right answer, and so that the desired length and scope are clear (and fit the question comfortably). Perhaps I am making this sound daunting. It need not be if you are collecting feedback in a regular way without getting on the students' nerves about it (see bullet point at end of list).
Encourage the students to interact more with each other. I think this is more important than eliciting a particular type of response to something you say in class. Again, this peer interaction need not be in class, and it need not be by speaking. You could be a facilitator of group discussion sessions (maybe 15 minutes per class once a week). If necessary, to break the ice initially, you could pose a topic of discussion that is not directly relevant to your subject -- just to help them over the hump. Using name tags with a fat magic marker so they are easily readable, for the first few classes, can be helpful.
Include information in your course about how your subject matter can be applied, and how it can be relevant on the job.
Explicitly encourage some assignments to be worked on in small groups. Don't wait until the last month of classes to give this type of assignment, because one of the purposes of this should be to facilitate the forming of study groups. Work a little bit directly with each working group, to make sure that each of your students is getting plugged into a group in a comfortable, functional way.
Allow and encourage humor in your class. Ask students to contribute a favorite funny math or science cartoon or short video clip, and project the best once a week.
You wrote, "I have asked about the motivation behind taking this course," but apparently you didn't get helpful information back. Try, instead, asking each student to give you a short info sheet about him or herself, including how the course fits into his or her academic goals. You could ask, for example, "What sort of learning style works best for you? What was your favorite class you've ever taken, and why? What was the worst, and why?" Explain that they don't need to write long answers to these questions (so you don't get on their nerves with what may seem like unnecessary, tangential work).
Think carefully about what you expect students to do while you are lecturing. Copy notes from board verbatim? Sit and watch the slides go by? Jot down additional notes on a powerpoint hand-out? Sit and watch the slides go by on their own laptops while you stand at the front of the room talking about the slides? Work the sample problems with you, trying to anticipate what the next step is? Look at a proposed proof you are displaying, to discover its strengths and weaknesses? Make up a problem of a certain type, for one or more classmates to try to solve? In other words, are they being set up for a passive role right from the start?
Observe other classes, perhaps in some other departments and institutions, to collect intriguing techniques and approaches.
Don't wait until the end of the semester to collect constructive feedback. You can ask simple, quick feedback questions at multiple points in the semester. Make sure students are comfortable doing this in an anonymous way, for example with an electronic tool that guarantees anonymity, or by asking a friend or colleague to step into your class (while you step out) for the last 5 or 10 minutes of class on the days you do one of these feedback questionnaires. (If your class is very small, and handwriting can be easily recognized, definitely go the electronic route.)
Keep in mind that human interaction is something like a seesaw. When you are overfunctioning, it is natural for the other party to underfunction. You may need to bring your own tone down, and be a bit less entertaining, in order to allow the others' personalities to come through. I have no idea whether you are coming on too strong and making some students uncomfortable in this way! To find out, ask a trusted colleague, friend or grad student to sit in on a class to provide feedback.