Tiamat and The Chromatic Dragons
In Mesopotamian religion Tiamat is a Chaos Beast, a primordial goddess of the ocean and is depicted as a serpentine dragon. The image we see of Tiamat in D&D is based off of another creature known as Lotan who is a seven headed sea serpent or dragon from Ugaritic myths. The reason Tiamat (and therefore the rest of the chromatic dragons) is evil is she is also based off of European dragons who were also portrayed as malevolent. Now the origin of the usage of the chromatic for the chromatic dragons I think would be Smuag since he was red and also evil.
Bahamut and The Metallic Dragons
Bahamut, from the Arabic myths we know as the Arabian Nights, was a fish and also one of the layers that supports the earth. Bahamut seems to be more based off of Eastern dragons; if you look at this picture of Bahamut drawn directly from the 1st edition monster manual, notice the "beard" he has and also the Chinese dragon historically was a symbol of the emperor of China who would have been considered the most honorable figure possible.
In the Chinese Zodiac the Dragon is a creature of myth and legend. A symbol of good fortune and sign of intense power, the Oriental Dragon is regarded as a divine beast - the reverse of the malicious monster that Westerners felt necessary to find and slay. In Eastern philosophy, the Dragon is said to be a deliverer of good fortune and a master of authority. Therefore, those people born in Dragon years are to be honored and respected.
So I think all of these thing helped influence the alignment of the dragons and the division between good and evil dragons.
Now as far as the breath weapon, most historical dragons seem to exclusively breath fire, although some dragons could control the weather, which I think inspired some of the other breath weapons such as Ice breath and lightning breath.
Historically Dragons were often portrayed as Divine or Astral beings and we're seldomly non-intelligent.