If you request attribute classc attr(), it simply returns the value as a single string. The condition will fail for your first <td>, because your code will try to compare
"firstCol noEdit" != "noEdit"
Which returns true (since they are not equal) and causes your warning to be displayed.
hasClass(), :
$('td').click(function() {
if (!$(this).hasClass("noEdit")) {
alert('do the function');
}
});