Hamilton was attempting to go as fast as he could to close down Button, in the laps after Button's and Hamilton's pitstops (of which there were quite a few). During that time he couldnt close Button down significantly. If anything, Button was the guy who was more comfortable. Furthermore, on a track like Singapore, the car behind needs to be significantly faster, which Hamilton wasn't.
It was a silly move because Hamilton wanted to catch and pass Button in approximately half a lap. Something, which he was unable to do in all the laps since the last round of pitstops. It wouldve been understandable, had Button been slowing down significantly, perhaps due to car problems, but this was not the case.
Please don't make excuses for Hamilton. He is currently my favourite driver, but even I can admit that he made a serious error in judgement. He himself admitted that it was a mistake and it's pretty obvious that he simply got carried away.