Hamlet found out the the players were going to Elsinore and so he was very happy and excited. it seems that the news brought him some kind of light, thus his mood changed. He treated them very nicely but Polonius seemed to be unhappy about this and treated them as they were lower class. It is important to clarify that players were entertainers that used to travel but they were poor.