Of Babylonian origin, the month was established in honor of the eponymous god Tammuz, which is a corrupt form of the Akkadian farming-god Dumuzi, the consort of Ishtar and the parallel of Adonis in the Greek pantheon. Beginning with the summer solstice, it was a time of mourning in ancient times: the Babylonians marked the decline in daylight hours with a six-day "funeral" for the god (see Ezekiel 8:14).
The ancient Israelites adopted this mourning ritual as well, linking it with the events leading up to the destruction of the Temple in Jerusalem. Today, Tammuz 17 is a Jewish fast day, marking the start of a three week period of mourning that culminates in Ab 9, the traditional date of the Temple's destruction in 586 BC and again in 70.
Tammuz was sentenced to the underworld by Ishtar as a punishment for his inattention when she was condemned there. Ishtar was restored to life by Enki but a "conservation of souls" law required her to find a replacement for herself in Kur. She went among many of the other gods, but could not bring herself to put them in her place until she found Tammuz on her throne, apparently oblivious to the fact that she was gone. Demons carried him off to the underworld. She took pity on him and through arrangement with Geshtinanna (Tammuz' sister), Tammuz and Geshtinanna each spend 6 months of the year in Kur. Tammuz being the god of crop fertility, this corresponds to the changing of the seasons as the abundance of the earth diminishes in his absence. He is a life-death-rebirth deity.