It's the safest place to save up bonus loot until you are ready to spend it, unless the resources in your storages are already enough (or almost enough) to reach the cap. Only 3% of loot stored in the Treasury will be stolen if an attacker completely destroys your Clan Castle.
You can view your stored loot by tapping "Treasury". From here you may also collect the stored loot.
The stored loot will be moved to their normal associated storages. This action can not be reversed. If the loot in the Treasury exceeds the available room inside a storage the excess will remain in the Treasury.
The player can earn 5 stars in multiplayer battles that earn you a loot bonus every 24 hours (exact period is a little shorter). The loot star bonus is stored in the Treasury.
The Treasurer achievement (formerly named Spoils of War) can be achieved by collecting certain amounts of Gold from the Treasury.
A substantial amount of loot can be earned each day just for earning five stars in battle. It will give you a certain amount of resources depending on your league.
This can be easily achieved in lower leagues as many abandoned bases still have their Town Hall outside their base.
Higher leagues give bigger bonuses. Try to balance your possible bonus with a league you can still be competitive in.
The Treasury is a safe way to store resources, as very little can be stolen. Keep it there until you need it!
The Treasury is a feature, not an exact building. The feature is located in the Clan Castle, so protect the Clan Castle.
If you quit a clan of at least level 2 and cause the treasury capacity of at least one resource type to drop below the amount you currently hold, the resource over the capacity won't be lost, but the treasury is considered full of that resource type, and unless you collect or get raided, any more of that resource type you gain into the treasury will be lost.
If at least one resource type in the Treasury is full (or over full due to quitting a level 2 or higher clan), a keyhole symbol with red background will appear above the Clan Castle.