My bug-or-not question is answered here: https://stackoverflow.com/a/13455272/533460
It's not a bug, it's a new feature of Razor 2!
What is happening in my code is based on this principle
<input checked="@ViewBag.Checked" type="checkbox"/>
becomes
<input checked="checked" type="checkbox"/>
when ViewBag.Checked == true.
So
<div class="@(main == "archive")"></div>
becomes
<div class="class"></div>
Thanks to @webdeveloper (https://stackoverflow.com/users/1667969/webdeveloper) for pointing me to the answer.