Locke has sort of turned into this particular island's resident Gilligan, but I can't really blame him for this one.

I assume He didnt know that entering "77" would blow the place up (based on the fact that I saw no indication that Sayid or Kate told him about the plastique). I think it would, in fact, be a more natural assumption to assume entering 77 would activate a distress signal.