You can't set the DefaultButton because the button is within a template and therefore doesn't exist until the template is generated. Also, when the user is logged in, the LoginTemplate is not visible, so the LoginButton wouldn't exist and you'd get the same exception.
You're best bet is to not use a LoginView for this particular scenario; just have the LoginButton on the page, the same as the search button, and control it within code. Something like this (not tested):
If Not Page.IsPostBack Then
If Not HttpContext.Current.User.Identity.IsAuthenticated Then
LoginButton.Visible = True
Page.Form.DefaultButton = "LoginButton"
Else
LoginButton.Visible = False
End If
End If