There are various reasons why swords have different shapes, but most of it is cultural. Note that in this case I count the military as possibly being a different culture then the society in which it exists. To a large extent it also reflects the culture’s feelings about individualism in warfare.
For example, the Roman Gladius was a short sword, which was straight, broad and relatively heavy for it’s length. It also tapered to a sharp point, and many had a second “edge” along the point. The reason this shape is that the Roman legions fought in close order. Each man right next to his neighbor, with a large shield leaving only a “slot” to either side of the soldier. The legionnaire would close in tight ranks and lines with his enemy, counting on his armor and large shield to protect him, and then just thrust the shield in and out of the small gap between his and his neighbor’s shield. The end result was that each legionnaire was not individual at all, but the entire group was very effective. The Romans lauded command and steadfastness in battle, not individual talent in killing.
To move to the Celts however, they favored fighting in little to no armor, but used longer and lighter swords. These swords required considerable room to use, as the user had to swing them for an effective impact. Thrusting was possible, but not common with this type of sword (at least for the Celts.) Each man almost fought on his own in battle though, as individuality was highly favored. A great warrior killed many foes, but his entire leadership may have just getting men to follow him because he was doing so well.
The Katana was great in one on one combat, or where the user didn’t have to worry about being close to his own men. It didn’t work so well in tight formations though. However, the Samurai gained honor and fame though his individual actions anyway, so he preferred to be separately identifiable from his allies.
Generally armies that fought in formation preferred to have shorter, straight swords. Individuals preferred to have longer swords, as they allowed the user to strike from a longer distance. It armor was common, the swords tender to grow heavier. As armor declined, swords became lighter but kept their length resulting in the fencing weapons of today.
Whether a weapon is curved or not depends on the culture and exact application to which is was to be used. As has been already mentioned in this thread, a curved weapon is easier for a cavalryman to remove while still moving. A curved weapon can also be more easily used in slashing motions that allows for drawing cuts that are best against light or no armor. Early curved weapons are rare due to the metal being unsuitable, or the culture’s metalworking skills being insufficient.
I’ve heard a theory that a country’s traditions for size and shape of sword are dictated by what their military has used a generation or two earlier. In some cases, owing to the slow change in technology, this had them using the same weapons. I’m not sure I buy this one completely though.