According to Wikinvest, nearly every country has its own stock exchange. Why should a company choose a stock exchange over another for trading its stocks? Aren't they conceptually the same nowadays, given the widespread use of electronic trading?
Nearly every country has its own exchange because so many countries have their own currency, and currency permeates every part of an exchange's business.
Generally, an exchange will support transaction and settlement only in local currency. Securities (except those that explicitly enable FX trading) are denominated and will trade in a single currency-- you can only buy a share of IBM in U.S. dollars. Securities trading always seeks to be a clean, frictionless, scalable process, and adding cross-currency translation to the mix would just complicate things. So it's one exchange, one currency.
In most countries, citizens and even businesses are largely restricted to having bank accounts in local currency. There are various political reasons for this, but there it is: it is difficult or impossible to open a domestic bank account in a foreign-denominated currency. A public company headquartered in a given country will be required to publish financial statements in local currency, will be more likely to do business with the local citizenry and businesses in that currency, and so will likely look for investors from that same pool-- which generally means listing in local currency, which means on an exchange in that country.
There are exceptions, of course. Big multinationals do business all over the world, and many seek investors all over the world as well. Mechanisms have been created to permit this (American Depositary Receipts or ADRs, for example). But once again, cross-currency translation makes things more complicated, so ADRs and their like are only practical for very big international players.
As to why there may be many exchanges in a single country, IMO Nick R has it right. Read "Flash Boys"; many market makers profit from trading between exchanges, and so have an interest in there being many of them. And in the U.S., regulators have expressed an interest in "innovation" in the exchange space, and so permit them. There is also an argument to be made against having a single "Too Big To Fail" exchange just like the argument for banks, but I wouldn't call that a "reason" for the current state of affairs.
Stock exchanges have been undergoing a period of consolidation for the past hundred years for the exact reasons you mentioned.
The existence of digital trading, harmonized laws and regulations, and fewer relevant currencies have made it more practical for mergers and acquisitions between exchanges.
Stock exchanges are most often times private companies that compete with other exchanges, so that also promotes the existence of many exchanges.
Why are there so many stock exchanges in the world? The simple answer is that there is a lot of money to be made by charging fees to facilitate the trading of securities, but there are other factors at play here relating to new technologies.
Trading volumes have increased rapidly in recent years. According to this ITG data, in 1997, 6.5 billion shares were traded on US exchanges. By 2015 this number had increased to 40.8 billion shares. There are a number of reasons for this rapid increase in volumes. Most significant would be the introduction of new technologies that allow for high volume, high frequency trading.
This increase in activity has be accompanied by an increase in the number of stock exchanges. As CQM points out in his answer, there has been considerable consolidation in the ownership of "legacy" exchanges. For example, the NYSE merged with EuroNext in 2007, and the combined group is now owned by the Intercontinental Exchange, which also owns numerous smaller stock exchanges as well as a number of derivative/commodities exchanges. However, this consolidation in ownership has been more than matched by the creation of many "virtual" exchanges.
In North America these virtual exchanges are called "Alternative Trading Systems". In Europe, they are called "Multilateral Trading Facilities".
These new virtual exchanges, sometimes referred to as "dark pools", have begun to significantly eat away at the volumes of the legacy exchanges. If you look at the ITG data (linked above), you will see that the total volume of shares traded on legacy exchanges actually peaked in 2008, and has since then has decreased. This coincides roughly with the appearance of the virtual exchanges and the new high frequency trading methods. According to this paper from the SEC site, dated 2013, Alternative Trading Systems accounted for 11.3% of total volumes in 2012. This will have increased rapidly in the years since 2012. It is this loss of business that has prompted the consolidation in the ownership of the legacy exchanges.
These new exchange are "conceptually the same" as the legacy exchanges and must play by the same regulatory rules.