How to exclude the entire result of a Grouped row based on a value of any of the rows it contains
You can use something like this:
Select Class, MAX(Item) 
FROM myTable 
WHERE class not in (
         select class from #demo where item  = 3
                    ) 
GROUP BY Class