There is not one single reason why baseball was dropped from the Olympic roster, as it was more of a large series of events.
2012 was the first year since 1980 that the Olympics did not include baseball in some form. In 2005, the International Olympic Committee (IOC) had a meeting where they dropped both Baseball and Softball.
The first step was in the 1990s when the IOC decided to create a limit of how many sports would be in the Olympics. As there were constantly more and more sports becoming viable options to add to the games, no sport was particularly safe.
Another factor was that Baseball is a sport with a lot of regional interest. It is very popular in North America and Asia, but not so much in European countries. A lot of the IOC influence comes from Europe, so it was not good for baseball when they had to decide what sports to eliminate.
Perhaps the biggest factor was the role that Major League Baseball played. The Olympics take place during the middle of the MLB season, so established stars have never participated in the Olympics. The NHL would shut down the league for two weeks, and allow players to represent their countries. The MLB would not do this, so it was always amateur players in the games
After the IOC's vote, Baseball appealed the decision. Unfortunately, they were told in 2006 that it was denied. The IOC voted once again in 2009, and kept them out of the Olympics in 2016 as well. After not being in the games for years, Baseball will finally be brought back to the Olympics in 2020 at Tokyo, Japan.