Needs and suppression are key factors.
If your students have generally satisfied needs they'll be more likely to enrol on voluntary programmes. It's also worth scheduling free-time immediately before work time so they can sort out any urgent needs and concentrate better in class.
Suppression will reduce enrolment and attendance. The suppressive effect is caused by lockdown/solitary punishments and by having armed guards close to inmates. You should consider removing punishments for minor offences and removing (or just moving) any armed guards. Punishments can also cause students to miss classes which reduces their probability of passing (you'll see the percentage increase in their profiles during lessons).
Another practical consideration is prisoners leaving before their studies are complete. The two education programmes take 30 days in total and min-sec prisoners will often be long gone before they can graduate. Take med-sec and max-sec intake and maybe even cancel your parole hearings too.
If you've registered for a Double ID and you're starting a new prison then the warden Leanne Johnston should be a big help too as she's described as boosting your education pass rates.