Works for me.
Here's a working query. I just executed it, then copied and pasted it here:
WHEN WorkCode in ('M', 'E', 'F') THEN 'Yes'
WHEN WorkCode in ('C', 'D') THEN 'No'
FROM (values ('a','b','M')) v(Firstname, Lastname, Workcode)
copy and paste this into ssms. It should work.
PS. you're running this on SQL Server, right? Which version?