While your code is fine as is, a better solution (that might have less issues anyway) would be to create a dataset with the desired states, and join against it (or use an exists clause if that is better for your needs). This is easier to maintain (as you can keep the dataset in an easily editable format separate from the code, like in excel) and may be faster in some cases.
data states;
input state_tp $;
datalines;
CT
MD
ME
NC
WV
;;;;
run;
proc sql;
create table test as
select Z.*
from sashelp.zipcode Z
inner join
states s
on z.state_tp=s.state_tp;
quit;
or
proc sql;
create table test as
select * from sashelp.zipcode z
where exists (
select 1 from states s
where s.state_tp=z.state_tp);
quit;