The entire batch of SQL is parsed/compiled before it is actually executed. Part of the compilation process includes validating that the various commands can complete successfully if they are eventually performed during the execution phase.
The first time you run the script the 'create table' is parsed/compiled and confirmed as a valid statement ... because the table does not exist, ie, if the 'create table' is executed then it should succeed.
The second time you run the script the 'create table' is parsed/compiled and found to be an invalid statement ... because the table already exists, ie, if the 'create table' is executed then it will fail.
The easiest way to get this type of coding to parse/compile/execute successfully each time it's run is to wrap the 'create table' command in an execute immediate construct, eg:
if exists (select name from tempdb..sysobjects where name = 'SSt_stats_purge')
print 'table exists'
else
exec("create table tempdb..SSt_stats_purge(scan_date datetime, value int)")