Unintended consequences are the surprising results of an action or decision.

When an outcome is not anticipated or foreseen, the situation at the end of a process may be different from what was intended.  In other words, purposeful action may create consequences which are 
 not intended (unintended)
 not anticipated (unanticipated) 
 not foreseen (unforeseen)

This concept is one of the building blocks of economics.  The term was coined and popularised in the 20th century. Its use has expanded into a range of contexts.

History
The idea of unintended consequences dates back at least to the 18th century when Adam Smith wrote about men who are "led by an invisible hand to promote an end which was no part of his invention".

American sociologist Robert K. Merton invented the phrase in 1936.

Types 
There are three types of unintended consequences:
 A positive, unexpected good effect is also described as good luck
 A negative, unanticipated bad effect in addition to what was expected
 A perverse, unforeseen effect which is outside the scope or opposite to what was intended

Causes 
Possible causes of unanticipated consequences include

Ignorance
 In other words, it is impossible to anticipate everything, and this leads to an analysis which is not detailed enough.

Error
 In other words, there is an incorrect or mistaken analysis.  For example, error might result from following a process or procedure which worked in the past but which does not work well enough or not at all in a new situation.

 Immediate interest
 In other words, the focus on short-term goals may be viewed as more important than long-term interests.

Basic values
 In other words, there may be factors which require or prohibit certain actions regardless of the long-term results.

Select examples 
There are examples and kinds of unanticipated consequences:

Unexpected and good
Aspirin is a pain reliever.  Among other things, aspirin affects the blood's ability to clot.  An unintended consequence is that aspirin is sometimes good for people with heart problems.

 Unexpected and bad 
 Rabbits were introduced in Australia and New Zealand; but without any natural enemies to slow the growth in numbers, there was an unanticipated consequence. There was a problem of too many rabbits in both countries.

 Unexpected and worse
 In India, the southern provinces had the problem of too many snakes.  The government tried to solve the problem by paying for dead cobras.  This was intended to bring down the number of cobras. Instead, it led to the breeding of cobras.  When the government stopped paying for dead cobras, the snakes were released—and the problem was worse than before the government tried to do something about it.

Cheaper and easier travel 
Cheaper travel, mostly in the form of air transport, is hugely beneficial to the economy by increasing tourism into a country. It accounts for 30% of the world's trade of services, and 6% of overall exports of goods and services. It also creates opportunities for employment in the services needed for tourism.

With increased tourism comes a variety of unlooked-for problems, such as increased illegal immigration. Perhaps even more serious is that returning tourists may bring back parasites and diseases which are not usual in the home country. Furthermore, many of these organisms are now resistant to most treatment.

Related pages 
 The road to hell is paved with good intentions
 Perverse incentive
 Moral hazard

References 

Sociology
Economics
Causality