There are a variety of reasons that 747s are not as popular as they used to be before and many of them have been mentioned above.
However, one thing not mentioned is that there is now much more competition in the air and there is far more point to point flying. This is the result of open skies agreements between nations. Nations used to limit the number of carriers and seats that could fly between cities (this still happens but not as much). For instance as late as 1990 Alitalia, Pan Am and TWA were the only carriers connecting the U.S. and Italy. Both Pan Am and TWA flew from JFK
to Rome and Milan using 747s. In 2004 you have Alitalia, American, Continental, Delta, Ethiopian and US Airways all connecting the two countries and none of these carriers operate 747s. Also there are non-stops from Atlanta, Cincinnati and Philadelphia nowadays. This means that there is more capacity but it's more spread out so it would be hard to fill up a 747 for any of the carriers.
Another point to mention is that up until the 1970s IATA used to set international air fares and they were largely upheld. This made it so that carriers would not lose money so there was less competition. By keeping prices artificially high, carriers were able to operate 747s that would otherwise not be profitable. Also sixth freedom rights were often limited, for instance today I could fly British Airways from Montreal to Athens with a stopover in London Heathrow. Well into the 80s many nations limited these rights to protect their national carriers my only other option would be to fly to Montreal and catch an Olympic Airways 747 to Athens.
Also people may wonder why their so popular with the transpacific market. The transpacific market is much denser than the transatlantic and less deregulated. There are two U.S. carriers that pretty much have the market cornered from the American side: Northwest and United. This is much like the transatlantic market before 1978 when TWA and Pan Am pretty much had the Atlantic to themselves from the American side.
Among the carriers that abandoned their 747s and here are some of the reasons that I know of:
Aer Lingus- though they were easy to fill on transatlantic runs during the summer, they usually had to be wet leased during the winter season. Left the fleet by 1994.
Alitalia- 747-400s were on order, but the order was substituted with 777s. They were probably easier to fill on a year round basis and could substitute the 747-200Bs as well as the MD
American- acquired 747s in 1970 but were too large for American's mostly domestic route network. Several were sold in 1974 after the oil crisis but were used until 1984 on flights to Hawaii. In 1986 747SPs were purchased from TWA for DFW
Avianca- used for European and North American flights but were too large and were replaced with 767s.
Continental- bought them in 1970 and used on flights to Hawaii until 1973. When they purchased People Express in 1987 they again became a 747 operator. However, these were phased out in favour of 777s in the 1990s.
Delta- acquired in 1970 with the anticipation that Delta would get transatlantic routes, however these would not come until 1978. They were flown around the U.S. on domestic routes and were finally abandoned in 1975 in favour of Tristars.
National- used from 1970 until 1975 on flights up and down the eastern seaboard as well as from Miami to London Heathrow. Were too large and substituted with DC-10s.
Olympic Airways- acquired in 1973 and eventually became the backbone of the longhaul fleet. Eventually they were replaced in the 1990s with A340s.
Sabena- were in the fleet until 1999 when they were replaced with A340s.
SAS- were far too large for the route network and were replaced with DC-10s.
Swissair- left the fleet in 1999 after the carrier decided to go all Airbus. Were replaced with MD
-11s until the A340s were supposed to come online.
TAP- arrived in 1972 when Portugal still had a colonies in Africa. Once the colonies were gone in 1975 they were hard to fill. Left the fleet by 1984.
Varig- acquired 747s in 1981 for flights to Europe and USA. However they proved too large and though 747-400s were acquired they were dumped for being too expensive to operate.