UPDATE statement processing records that should be eliminated by WHERE clause
You should not make any assumptions about how SQL Server will process your query, except this: you should always assume that SQL Server can process your query in a way that is different from how it is explicitly written on the screen. And also this behavior can change based on any of the factors that can influence whether a new plan will be used for the next execution of even the same query, so if you apply a hint or change the query in any way or add or remove an index and the error goes away, don't assume the error won't come back tomorrow.

In this case, SQL Server is processing a calculation before it is eliminating rows from the WHERE clause. The way you avoid this is, like you said, ensuring that those rows are also filtered out inside the CASE expression (not statement).

A more common but similar approach is this kind of thing:

SELECT DATEPART(MONTH, varchar_column)
FROM dbo.some_table
WHERE ISDATE(varchar_column) = 1;


In many scenarios you will get an error message because SQL Server tried to apply the date functions against some values in the column that didn't turn out to be dates (and this attempt occurred prior to filtering). The workaround is tedious - use the CASE expression - but necessary unless you have some other way to verify the worthiness of the column (e.g. a computed column or fixing the data type in the first place). Just keep in mind that even this can fail to "short circuit" in some scenarios.

SELECT CASE WHEN ISDATE(varchar_column) = 1 
  THEN DATEPART(MONTH, varchar_column) END
FROM dbo.some_table
WHERE ISDATE(varchar_column) = 1;


This is explained more thoroughly in the following feedback item by Erland Sommarskog:


SQL Server should not raise illogical errors