No Export for You/Analysis
Sometimes, the reason is legitimate. In the older days of gaming, when the Blind Idiot Translation ruled, games with lots of text might be too hard to translate (though this is a very weak excuse in today's world). Some things are just too flippin' weird to be understood outside their home nation by most people, as some cultural differences can get a series in hot water if what's tolerated or even welcomed in one country is taboo in another. Sometimes, what's being made is for something that's used differently elsewhere (read: most Japanese cellphone games). Then there are simply the times where the company thinks it wouldn't sell well. Another legitimate reason is, well, legal reasons, especially concerning the licensing of characters appearing in a Massive Multiplayer Crossover. And finally, with video game remakes and re-releases, some companies, most notably Sony, require a certain amount of new content before they'll agree to import it.
For Anime, there's another justification, coming from the way anime is made. Japan's animation industry is structured very differently from most other countries' -- shows aren't made by large companies with centralized legal departments, which are able to sort out licensing issues, but by throngs of small, semi-independent studios, uniting in tenuous and short-lived alliances often meant to produce just one specific series. As the thing goes, when some animators come to an idea of the show, they try to pitch it to some media giant, which, in case of success, just dishes out the money and takes distribution rights. The original production studio then contracts numerous other studios to do animation, music, postproduction, etc., while the distributor handles advertising, merchandise rights and such. So, when the show is finally released, there are sometimes dozens of companies, each holding a copyright to some aspect of it, and sorting these rights for licensing or rerelease may get literally impossible—sometimes even in Japan itself. And until recently, few people even considered the idea that there could be a market for most anime outside of Japan.
Well, you might ask, if there is a licensing problem for distribution, how could the show have even been made for broadcast? Wouldn't there have been licensing issues then too? Well, yes and no, and I'm glad you asked that question because it requires explaining about Copyright and the general licensing systems cobbled together over the decades that we've had mechanical reproduction on video and sound.
There are two types of licensing involved in a television or radio program, performance licensing and reproduction licensing. Performance licensing, which is needed for broadcast, is easy; networks pay a blanket fee of about 3% of their income to the major performance licensing agencies, ASCAP and BMI, and to a lesser extent SESAC. This solves the problem and they can use any music they want. In the US, use of phonograph records in broadcast doesn't require licensing (which is why radio stations originally started playing recorded music) so that's it; in Europe broadcasters pay an additional fee. So thats it; licensing for the use in a broadcast is automatic and is just a cost.
However, to reproduce a work containing a song in a video, such as a release of an episode of a TV program, they have to get a reproduction permission for the music, and if it was from a CD or other phonorecord, they would need permission to reproduce the record performance also. For example, if someone wanted to use Joe Jackson's "Stepping Out" in an episode of a show, Jackson is both the songwriter and performer so they only have one party to ask. If, however, they wanted to use Mannfred Mann's "Blinded by the Light" they would need permission from the songwriter, Bruce Springsteen, and by the performing group, Manfred Mann. (Actually you ask their publisher who then usually asks the artist.)
In the case of someone who wants to make a recording such as a cover version of a song, that's considerably easier (like the example of Manfred Mann's cover of Bruce Springsteen's "Blinded By the Light.") Makers of sound recordings can get an automatic license to do a cover version; if the music publisher won't agree on a license, you file a form with the U.S. Copyright office and twenty bucks, then you pay a fee to the music publisher for each one you sell. The fee is relatively minor, it's roughly 6c per copy or 2c a minute of playing time, whichever is greater.
This automatic license is not available for films; anything you use has to be negotiated with the rights holder directly, for each and every item used. If you miss any and the rights holder finds out, they can get anything from severe monetary damages (potentially hundreds of thousands of dollars) to (in certain cases) "impoundment and destruction" of the infringing work.
So it can be the reason a work isn't released is problems with other parties who worked on it wanting too much money, or being unable to get permission for some of the included songs, or deciding it's too much trouble (or there's considered not enough money to be made in a release) to justify going to the effort and trouble to work out all of the necessary clearances.
But many times it's just none of those reasons, or any apparent reason at all. It could be conveyed as a type of favoritism or nationalism, but for many fans of a series outside the home country, it seems nothing more than a giant middle finger to the rest of the world, with the message, à la the Soup Nazi: "No Export for You!" It just shows that the creators are xenophobic, and it's uncool.
Arguably one of the biggest causes of Internet piracy (you don't have many other choices when nobody will do a legal release). People in isolated areas can get very angry about this, which is why there are other choices. At the same time, infuriatingly, Internet piracy can also be a major cause of this in itself: while some companies have taken large amounts of downloads of their product in an area where it's not currently available as a sign of demand, others may think it's not worth releasing something in an area where people will just download it for free anyway.