Why was the Israelite king called “son of God”?
The study of ancient Near Eastern practices could be helpful in identifying similarities and differences with respect to the biblical text. The topic you have raised could possibly be one of those practices. Here the Bible provides its own particular perspective.
Ancient Near Eastern Ideas
Throughout the ancient Near East, kings were considered to be sons of god/s. In Egypt the pharaoh was literally viewed as a son of god and consequently believed to be divine. It is still debated whether in the rest of the ancient Near East kings were considered divine. Some scholars, influenced by ancient Near Eastern ideas, argued that Israelite kings were also considered to be divine. The truth is that outside Egypt, evidence for the divinity of the kings is not abundant, implying that divine kingship may not have been the common view in Mesopotamia, Assyria, and possibly Canaan. The title “son of god” designated the kings as legitimate representatives of the gods, perhaps with quasi-divine characteristics and functions.
The Israelite King
Scholars generally agree that in Israel the royal title “son of God” did not mean that the king was divine but that during the enthronement ceremony the king was adopted as God’s son. Psalms 2:7 is considered the key text: “You are My Son, today I have begotten you.” The phrase is considered to be an adoption formula pronounced by the adoptive to legalize the adoption. This is a mediating position in the interpretation of the title that, although possible, is questioned by others. There is no evidence for the use of this specific “adoption formula” in the Old Testament, and neither is it used as such in the ancient Near East. We find similar language in Egypt applied to the pharaoh, but in this case it describes the real conception of the king as a god.
In Psalm 2:7 the phrase “son of God” is used metaphorically, as shown by the parallel phrase “today I have begotten you.” This is not about a natural birth or an adoption, but about the use of language to designate the moment the person is, so to speak, “born” as king in the sense of being appointed as such by God as a vassal through the anointing (verse 2). Filial language is used to describe the new relationship established between God and the king (2 Sam. 7:14; Ps. 89:27). The new “born” king is under the protection and care of God. Possibly a good parallel is the divine proclamation of Israel as God’s son (Ex. 4:22, 23), which constituted them into God’s people. The central concept is divine election and not necessarily adoption.
Son of God and Messiah There are some parallels between the use of the title “son of God” in Israel and other nations. After all, kings performed many similar tasks. It is most probable that in Israel the title carried with it messianic significance from its very beginning, pointing to the coming of the true and unique Son of God, who was truly divine (cf. Ps. 45:6; Isa. 9:6). The biblical trajectory of the coming Savior begins with the promise of a son made to Adam and Eve (Gen. 3:15). Throughout the patriarchal stories the promise of the Son provides a unifying thread (e.g., Gen. 12:7; 15:3, 4). With the institution of the monarchy God brings together kingship and the promise of the messianic Son (cf. 2 Sam. 7:12-14; 1 Chron. 17:11-13), which found fulfillment in Immanuel, the Son of a woman and the Son of God (Matt. 1:23; Luke 1:32).