That's because you are using LINQ To Entities which is ultimately convert your Lambda Expressions into SQL statements. That means the case sensitivity is at the mercy of your SQL Server which by default has SQL_Latin1_General_CP1_CI_AS Collation and that is NOT case sensitive.
Using ObjectQuery.ToTraceString to see the generated SQL query that has been actually submitted to SQL Server reveals the mystery:
string sqlQuery = ((ObjectQuery)context.Thingies
.Where(t => t.Name == "ThingamaBob")).ToTraceString();
Your Example-
var demo=((ObjectQuery)context.UserDetails.SingleOrDefault(x=>x.UserName==UserName && x.Password==Password)).ToTraceString();
Please find here for more details