The advantage that a flail has is the advantage that a martial weapon has over a simple weapon.
The flail and mace are both one handed weapons with bludgeoning damage. Neither has the versatile property.
The flail does 1d8, the mace does 1d6. (Weapons Table, Basic Rules, p. 46)
Comparing it to the war hammer, which has the versatile property and is a martial weapon, the flail comes off second best. This only matters, cost wise, at early levels in a campaign where having to make choices based on rolling for gold pieces factors into it.
- Choose Equipment (Basic Rules, p. 9) Your class and background determine your character’s starting equipment, including weapons, armor, and other adventuring gear. Record this equipment on your character sheet. All such items are detailed in chapter 5, “Equipment.“ Instead of taking the gear given to you by your class and background, you can purchase your starting equipment. You have a number of gold pieces (gp) to spend based on your class, as shown in chapter 5.
Looking on page 43 of Basic Rules ... Starting Wealth by Class ...
Cleric...5d4 X 10 GP.
The advantage shows up in the case of a cleric where the character prefers a (weapons) / (shield) fighting style, and perhaps gets the Shield Master feat. Being able to use a flail is advantageous over a mace. Another reason to use a shield and a one handed weapon is that a cleric can use the shield, emblazoned with her holy symbol, as a spell casting focus.
For classes that start with proficiencies in martial weapons, the warhammer seems the better choice.
Regarding weapons proficiencies for a cleric: War and Tempest domains have martial weapons proficiencies, most other domains do not. The Life Domain cleric has proficiency in medium armor, shields, and simple weapons. (Basic Rules, p. 21) Being able to use a flail with proficiency, as a Tempest cleric, is a slight advantage in damage over the mace.
Compared to other similar weapons there seems to be zero reason to use
a flail.
Beyond what I already covered, it may be a matter of style. Optimization isn't everyone's chosen method for character creation, nor play style.