Origins
Flame and black are secret siblings. Both descend from Proto-Indo-European *bʰleg-, meaning 'to shine' or 'to burn'. Through Latin, the burning produced flame. Through Germanic, the burnt residue produced black. One word for the fire, another for what the fire leaves behind.
Latin flamma (from earlier *flagma) came from flagrāre, 'to burn or blaze'. Flagrāre gave English flagrant — a flagrant act is a blazing one, impossible to miss. The legal phrase in flagrante delicto means 'in the blazing offence', caught in the very act of burning.
The romance languages all inherited flamma. French flamme, Spanish llama, Italian fiamma. Spanish also produced flamenco and flamingo — the bird whose plumage looks like fire. Portuguese took it further: chamar ('to call') descends from Latin clamāre, but the similar-sounding chama ('flame') keeps the fire alive.
Middle English
English borrowed the word through Anglo-French in the 14th century, inheriting both the literal and figurative senses. An old flame is a former lover whose passion has burned out. To inflame is to set fire to — whether tissue (inflammation) or a crowd (inflammatory rhetoric).
The metaphorical leap from fire to passion is ancient. Latin flamma was already used for romantic desire in the poetry of Ovid and Virgil, two thousand years before English adopted the same image.