This is a good question and one worth asking, but it is important that the motivation behind such a question is correct. It is also important that we are seeking answers to the right questions.
An imprecatory psalm is one in which the psalmist asks that God curses the psalmist's enemies. These are psalms of anger or wrath. Examples include Psalms 35, 55, 59, 69, 79, 109, and 137.
Getting back to the question at hand, we must first deal with some underlying issues found within this type of questioning. First, it is not the duty of man to judge what should or should not be inspired Scripture. If it were our responsibility, our Bibles would be substantially thinner as we would remove every verse we do not care for or find difficult. Instead, man, through the guidance of the Holy Spirit identifies what is and is not the inspired Word of God. Second, God is infinitely bigger than the attribute of love as man defines and then places upon God. It is not our responsibility to define God or his love. So you are left with a couple of decisions: you can accept that the imprecatory psalms are indeed inspired Scripture or you can reject this notion, and you can accept that God is indeed good and loving as his inspired Word claims or you can reject this idea as well.
At the root of this question is a much bigger question. It is not about inspiration of Scripture, but instead about a paradox. How could God allow this kind of prayer to be a part of his message to his creation? How could a good and loving God put his endorsement on such difficult language when the New Testament clearly teaches that we should love our enemies? As we look at Scripture we find many more situations like those of the imprecatory psalms. In these situations our understanding suggests a paradox, but our ways are not God’s ways and our understanding is not God’s understanding. We do not have the right or authority to place ourselves above God and then dictate what God should or should not do by our standards. God sovereign functions by God's standards.
We are like little children. Sometimes children ask things of their parents that may seem unreasonable or outright awful, yet in the case of children and parents, we understand what's going on. Think about how many times a young boy has wanted his father to beat the living tar out of one of this boy’s young enemies. Could you imagine it, a 220lb father kicking the crap out of a 6-year-old boy? But just because the boy asks, doesn't mean it will happen. Now image that the boy did ask and sometime later the father retold the story to make a point or teach his children something. Would we place judgment on the father for telling the story? Would we assume that father said yes to the boy's request or even totally endorsed the boy's request? The father could be retelling the account as a way of teaching something real and good about the relationship between the boy and the father, or maybe about the trust and care that the boy knows the father gives him, or even that the boy fully understood the father's ability and might. If we first place judgment upon the father for retelling the story, we may actually miss the point the father is trying to teach. If this is the case between a father and a son, how much more might these imprecatory psalms be something more between the creation and the Creator? It may not be about our standards that we want to place upon God; it could be God showing us something. Don't miss the point of these imprecatory psalms because they would be something you would prefer to cast judgement upon.
* Photo of barbwire by Louis Parravicini. Photo of father and son by Sarah Horrigan. Both are used by permission.