When dealing with practical applications of hyperspectral imaging, the development of efficient, fast and flexible classification algorithms is of the utmost importance. Indeed, the optimal classification method should be able, in a reasonable time, to maximise the separation between the classes of interest and, at the same time, to correctly reject possible outlier samples. To this aim, a new extension of Partial Least Squares Discriminant Analysis (PLS-DA), namely Soft PLS-DA, has been implemented. The basic engine of Soft PLS-DA is the same as PLS-DA, but class assignment is subjected to some additional criteria which allow samples not belonging to the target classes to be identified and rejected. The proposed approach was tested on a real case study of plastic waste sorting based on near infrared hyperspectral imaging. Household plastic waste objects made of the six recyclable plastic polymers commonly used for packaging were collected and imaged using a hyperspectral camera mounted on an industrial sorting system. In addition, paper and not recyclable plastics were also considered as potential foreign materials that are commonly found in plastic waste. For classification purposes, the Soft PLS-DA algorithm was integrated into a hierarchical classification tree for the discrimination of the different plastic polymers. Furthermore, Soft PLS-DA was also coupled with sparse-based variable selection to identify the relevant variables involved in the classification and to speed up the sorting process. The tree-structured classification model was successfully validated both on a test set of representative spectra of each material for a quantitative evaluation, and at the pixel level on a set of hyperspectral images for a qualitative assessment.