Why can't I use variables in T-SQL like I imagine I can?
Per the Books online page for variables


  Variables can be used only in expressions, not in place of object
  names or keywords. To construct dynamic SQL statements, use EXECUTE.


It would work the way you were expecting if, for example, you used your variable in a where clause. As for why, I would think it has something to do with the parser not able to evaluate the variable and thus check for existence. When executing, the query is parsed first for syntax and objects and then, if parsing successful, the query executes at which point the variable would be set.

DECLARE @name varchar(20);
SET @name = 'test';

CREATE TABLE [#tmp]([val] varchar(10));

insert into #tmp
values('test')

SELECT *
FROM [#tmp]
WHERE [val] = @name;