Preventive-detention legislation has been introduced in various forms in legal systems around the world to allow for the ongoing detention or community supervision of sex offenders following the completion of their custodial sentences. The stated purpose of these laws is utilitarian: they are intended to protect the community and allow for the ongoing rehabilitation of the offender. However, judges and legal scholars have expressed concern that retributive, rather than utilitarian, motives might drive decisions regarding the ongoing management of sex offenders. These concerns align with psychological research on procedural and distributive justice. In this article, we review the relevant psychological literature, which shows that notions of morality and deservingness are key motives underlying justice reasoning and sentencing decisions. We discuss the ways in which retributive and utilitarian motives may impact upon preventive detention decisions, and how this psychological research can inform legal scholarship on the issues surrounding preventive detention.