Why was carbon-12 chosen for the atomic mass unit? The atomic mass unit is defined as 1/12th the mass of a carbon-12 atom. Was there any physical reason for such a definition? Were they trying to include electrons in the atomic mass unit?
Why not define the amu as the mass of one proton or neutron so that in nuclear calculations at least one of the nuclear particles (out of protons and neutrons) would be a nice whole number?
 A: The mass of a particular nucleus is not equal to the sum of masses of the constituent particles. From this perspective, whichever isotope (or mix of isotopes) will be chosen as the definition standard, no other isotope (or mix of isotopes) will end up as a nice integer.  
For example, if carbon-12 has six protons and six neutrons, one might expect hydrogen-2 (deuterium; one proton + one neutron) to have its atomic weight exactly 2, but the actual value is 2.014. To make sense of this, consider nuclear fusion reactions that ultimately produce carbon-12 out of deuterium.  The reactions release energy and the energy released exactly equals the "lost" mass (via $E = mc^2$). It's not a clean counting game with protons and neutrons.
Electrons do not have much to do with this. It's rather a matter of strong interaction among the nucleons inside the same nucleus. The strong interaction determines the "comfort level" of the nucleons and therefore the potential energy involved in fusion or fission, and therefore it co-determines the mass of the nucleus.
From this perspective, you could have one isotope with a "nice" atomic weight, but any others will end up with totally "weird" atomic weights.  From this perspective it does not matter too much which isotope you use as the standard, as long as the communities are ready to accept your proposal.
A: There already are two good answers to your question, but I still would like to complement and answer more specific to your questions:

The atomic mass unit is defined as 1/12th the mass of a carbon-12 atom.

This is not correct. The unified atomic mass unit u is defined as 1/12th the mass of a carbon-12 atom. The atomic mass unit (amu) is defined as 1/16th the mass of the oxigen-16 isotope (physics) or 1/16th of the (average) mass of an oxigen atom (chemists).

Was there any physical reason for such a definition? 

No, but there are chemical reasons. Chemists want the numerical value of the "atomic weight"  in unified atomic mass units to be the same as the numerical value of the molar mass. For example: the molecular weight (which is the abundance weighted average of the isotope masses of an atom) of C is 12.0107 u and its molar mass is 12.0107 g/mol. This allows chemists to jump easily between macro and the micro world. 

Were they trying to include electrons in the atomic mass unit?

Yes, because when chemists measure the mass of elements or substances, these are essentially neutral. Think about chunk of carbon, aka diamond.

Why not define the amu as the mass of one proton or neutron so that in nuclear calculations at least one of the nuclear particles (out of protons and neutrons) would be a nice whole number?

Because chemists are not interested in nuclear particles. They usually measure substances (molecules).
Physicists typically use other mass units: $m_e$ = mass of electron, $m_P$ = Planck mass, etc.
A: 
Why was Carbon-12 chosen for the atomic mass unit?

As is the case elsewhere in metrology, the answer is tied up in history,  measurability, practicality, repeatability, past misconceptions, and consistency (despite those past misconceptions).
The history of atomic mass and the mole (the two are quite interconnected) goes back to the early 19th century to John Dalton, the father of atomic theory[1]. The unified atomic mass unit is named after him. Scientists of that era were just learning about elements; the periodic table was 60 years in Dalton's future. Dalton initially proposed using hydrogen as the basis. Issues of measurability and repeatability quickly cropped up. So did mistakes. Dalton, for example, thought water was HO rather than H2O[2].
These issues resulted in chemists switching to to an oxygen-based standard based on the oxygen found on Earth. (That elements can come in multiple isotopes was not known at this time.) Physicists' investigations at the atomic level caused them to develop their own standard in the 20th century, based on 16O rather than the natural mix of 16O, 17O, and 18O (atomic masses: 15.994915, 16.999131, and 17.999161, respectively, with a nominal mix of 379.9 ppm for 17O, 2005.20 ppm for 18O, and the remainder 16O) used by chemists.
The natural mix of the various isotopes of oxygen is not constant. It varies with time, place, and climate. Improved measurements and more widespread usage made repeatability become a significant issue by the middle of 20th century. The primary cause is natural variations in the two most common isotopes of oxygen, 16O (the dominant isotope) and 18O (about 2000 parts per million, on average). The IUPAC Technical Report[4] on atomic weights of the elements lists the atomic weight of naturally occurring oxygen as varying from 15.99903 to 15.99977.
The primary cause of these natural variations is the preferential evaporation and precipitation of water molecules based on various isotopes of oxygen. Water based on 16O evaporates more slightly readily than does water based on 18O, making tropical oceans a bit concentrated in 18O compared to average. On the flip side, water based on 18O precipitates slightly more readily than does water based on 16O. This makes precipitation in the tropics have slightly higher 18O concentrations compared to nominal, and it makes precipitation in high latitudes have slightly lower 18O concentrations compared to nominal.
Physicists had a solution: Switch to their isotopically pure 16O standard. This would have represented an unacceptably large change (275 ppm[3]) in chemistry's oxygen-based standard. It would have required textbooks, reference books, and perhaps most importantly, the recipes used at refineries and other chemical factories to have been rewritten. The commercial costs would have been immense. It's important to keep in kind that metrology exists first and foremost to support commerce. Chemists therefore balked at that suggestion made by physicists.
The carbon-based standard represented a nice compromise. By chance, defining the atomic mass as 1/16th of the mass of a mole of oxygen comprising a natural mix of 16O, 17O, and 18O is very close to a standard defining the atomic mass as 1/12 the mass of a mole of 12C [3]. This represented a 42 ppm change from the chemists' natural oxygen standard as compared to the 275 ppm change that would have resulted from changing to 1/16 of the mass of a mole of 16O [3]. This new standard was based on a pure isotope, thereby keeping physicists happy, and it represented an acceptably small departure from the past, thereby keeping chemists and commerce happy.

References:

*

*Britannica.com on John-Dalton/Atomic-theory entry
I'm leary of referencing wikipedia. Britannica is still fair game for basic facts.


*Class 11: How Atoms Combine
Dalton's mistake on assuming water was diatomic is widely reported. This is one of many sites that make this claim on Dalton's mistake.


*Holden, Norman E. "Atomic weights and the international committee–a historical review." Chemistry International 26.1 (2004): 4-7.
I found this after the fact, after Emilio Pisanty asked me to find some references. This says everything I wrote, only better, in more detail, and with lots of references.


*Meija, Juris, et al. "Atomic weights of the elements 2013 (IUPAC Technical Report)." Pure and Applied Chemistry 88.3 (2016): 265-291.
See table 1, and also figure 6.
