Example 1:
<head>
<meta http-equiv="description" content="<%= Foo %>"/>
</head>
Renders
<meta http-equiv="description" content="Bar"/>
Example 2:
<head runat="server">
<meta http-equiv="description" content="<%= Foo %>"/>
</head>
Renders:
<meta http-equiv="description" content="<%= Foo %>"/>
Note the discrepancy, the <
has become <
but the >
remains the same.
There are some questions on this topic, and the answers are the workarounds, but nobody seems to know why this happens.
You can't have a script tag (<% = %>) inside a server control, that's why it's turned into plain text instead of being executed.
You can add the meta tag from the code behind like this:
HtmlMeta meta = new HtmlMeta();
meta.HttpEquiv = "description";
meta.Content = Foo;
Page.Header.Controls.Add(meta);
When you add runat=server the Head tag becomes a server control. I guess based on your results that the contents of server controls are not parsed for inline substitutions using the <% ... %> syntax.
You could make the Meta tag a server control as well by adding the runat=server to it and access its attributes programmatically.