Among the most important customs of the ancient Greeks was xenia, or hospitality. It was considered essential that strangers were treated with respect and consideration by their hosts. In a violent, dangerous society where conflict was ever-present, it was essential to have some kind of custom in place to protect travelers and to keep the flow of trade running smoothly.
Throughout his epic journey, Odysseus is the beneficiary of xenia on a number of occasions. One thinks of the lavish hospitality laid on for him by the Phaeacians, for instance. Since hospitality was crucially important to the Greeks, it was not be taken advantage of. Yet that's precisely what Odysseus does when he arrives on the island of Polyphemus, the giant Cyclops. Here, he (unrealistically) expects the kind of hospitality he received from the Phaeacians.
But Polyphemus is a monster, not a civilized member of society. So Odysseus gets more than he bargained for, with many of his crewmates ending up inside the giant's hungry belly. It was surely foolish of Odysseus to expect Polyphemus to honor the host/guest relationship that constitutes the custom of xenia. And in his foolishness, he risked the lives of his men. He took advantage of their loyalty, leading them into a situation fraught with danger, where he must have at least suspected that the normal rules of hospitality would not be faithfully adhered to.