From the Encyclopedia Judaic

The rendering of the tithes of property for sacral purposes was common all over the ancient near east, though well documented and first hand evidence concerning thithes comes mainly from Mesopotamia. Alyough these Mesoptoamin documents come from the neo-Babylonian period (sixth century B.C.E.) there is no doubt that the institution as such is much older. In the Syro-Palestine area the tithe (masartu; cf Hebrew maser). is found in Ugarit in the 14th Century B.C.E. (Palais royal d'Ugarit, 3 (1955) 147: 9-11). The Tithe was not assigned to the temple only.
As may be learned from I Samuel 8:15-17 and from Ugarit ( in the aforemetioned example). the tithe could also be a royal tax which the king could exact and give to his officals.This ambiguity of the tithe, as royal due on the one hand and as a sacred donation on the ohter, is explained by the fact that the temples to which the tithe was assigned were royal temples (cf. esp. Amos 7:13) and such, the property and treasures in them were put at the king's disposal. This can best be exemplified by th two instances of thithe mentioned in older sources of the Pentateuch (J.E.).
Genesis 14:20 Abraham gives a tithe (after his battle with the four kings of the north) to Melchizedek the King-priest of Shalem (=Jerusalem) and in Genesis 28:22 (cf. also Amos 4:4) Jacob vows to pay a tithe at Beth-El the "royal chapel of the Northern Kingdom (Amos 7:13).
The Mention of specifically these two "royal temples" in connection with the tithe is not a coincidence. It seems that these traditions have have an etiological slant. The instition of collecting tithes in the northern royal chapel Beth-El is linked to Jacob, the ancestor hero par elcellence of the northern tribes, while the instition of the tithe in the royal sanctuary of Jerusalem is traced back to Abraham, whose traditions are mainly attached to the south. All is well known, the kings controlled the treasures of palace and temple alike (I Kings 15:18 ; II Kings 12:19 ; 18:15), which is understandable, since they were responsible for maintenance of the sanctuary and service not less than for the servicec of the court (cf. Ezek. 45:17, etc.)
It stands to reason that the tithe, which originally was a religous tribute, came to channeled to the court, and was therefore supervised by royal authorities. This is actually attested in II Chronicles 31:4 ff. where Hezekiah is said to organize the collection and storage of the tribute including the tithe. Though the description of the event comes from a late and tendentious source, its authenticity is supported considering that as the Mesopotamian tithe was organized a long similar lines (cf. also the organization of Neh. 10:38; 12:44, 47; 13:5,12) The annual tithe of the Cartaginians, which was sent to the Temple of Melqartin Tyre (Diodorus 20:14) is understood in like manner. The Temple of Melqart was the state treasury of Tyre, and so the tribute paid by the Carthaginians had political character besides its sacred one.