The Psalms were not written by man; they were written by God. David learned this truth from his God and wrote down what God revealed to him.
David learned how to approach Israel's God, and what issues were on God's heart. He was passionate about God's will being fulfilled on earth. He knew what the congregation had to do to please their God; he wrote things that would truly glorify God. The LORD put David in this critical place in history just for this very purpose - to inform the Israelites (and us) about the kind of worship that identified, and glorified, the only God. The Mission? To bless the people of God with the Covenant Promises, in strict accordance with the Law of God, by means of a divinely structured Kingdom on earth. So the Psalms aren't an option for God's people, they were mandatory for them. And if we want to please God, this is how we also must worship him. It's a pattern for the entire Church - past, present and future.