A good portion of objections to the Bible come under a rubric where ancient moral codes and views are pronounced inferior, or where a given statement is found to be disgusting or revolting. For example, one skeptic states in a popular newsletter: "...the law code of the OT would be considered harsh in any age. It doesn't 'seem' to be harsh according to present societal standards. It is harsh, and would be considered harsh in any era."
We do not find it necessary to address each charge of this sort in detail, but, we will look at three examples.
Our broad example looks at an ancient concept called "corporate responsibility." (Link 1 below.) Under this notion the firstborn of Egypt died for the misdeeds of their king, and our skeptic complains mightily: "Why should the firstborn children in Egypt die because of the deeds of a tyrannical ruler?"
These are the words of a modern person living in comfort. But corporate responsibility in the ancient world had a mirror image: Corporate survival. Ancient peoples lacked such conveniences as automobiles, drug stores, and firearms; even in an urban setting, an extremely high degree of interdependence was required to survive. The people depended upon their rulers for their very lives, and so owed him their support.
On the other hand, if your ruler made a mistake, it was quite fair if you suffered --- because you were truly interdependent with him.
Now to a second and more specific subject. Regarding Deut. 22:28-29 ---
If a man happens to meet a virgin who is not pledged to be married and rapes her and they are discovered, he shall pay the girl's father fifty shekels of silver. He must marry the girl, for he has violated her. He can never divorce her as long as he lives.
Of this, a critic finds much that is unfair. But knowing the social context does a world of good. (There is also another explanation at Link 2 below that is worth a look.)
First, our subject objects that the victim may not want to marry the rapist. In modern times this would be a sensible objection; but for the ancients, this was a highly viable and indeed merciful solution. The victim would no longer regarded as marriageable and would therefore lose means of interdependent support. The rapist is here being required to provide that support.
It is quite unlikely in this social context that the victim would refuse this arrangement; indeed, they might well demand such an arrangement. This is not a matter of having the rapist be one's loving partner, or cohort for further sexual relations.
Second, it is asked why the father gets money rather than the victim. This is related to another ancient practice, the dowry. A girl who is married becomes part of a new family, which she goes on to support of her own means, and now relies upon for support; at the same time, her former family loses her support and assistance in daily survival, but gains nothing practical in return - hence the dowry.
The effect of the dowry was to make up for that loss of essential support, and in light of the first item above, payment to the father is quite fair, for it is his family that must now continue to support the girl for the rest of her life.
Some may still find the above objectionable; certainly some would continue to rail about the unfairness of it all. But critics have no right to make moral judgments of any kind upon those whose situations they have not lived in themselves. (Note as well, as one reader added, that as closely guarded as women were by their families, it may be that the woman here was the initiator, and that the "rape" is not a rape at all; the Hebrew word merely means "lie with" and forced intercourse is only assumed by implication.)
Now here is a more modern example. One critic objected to the use of words like "piss" and "dung" in the KJV Bible, asking if we'd want our kids reading these in Sunday School. A minister replied:
Would I want my child reading this on Sunday? Yes! Providing that he is taught why these words were used, it would be perfectly acceptable. They are not used in a pornographic way; they were used to speak of bodily functions and the last extremities of a prolonged siege. I have even quoted this language from the pulpit. The Bible uses the word "ass" to speak of the donkey; men, today, make it dirty and filthy. The Bible speaks of "hell" to refer to either the grave, the realm of the unseen for the wicked, or eternal punishment for the wicked. Men, today, use it as a slang and dirty word. The problem is not with the Bible, it is with our attitude in how we use certain words. If one finds these words offensive, another translation can be used.
To this, the critic replied:
All you are doing...is resorting to the old "you are taking it out of context" defense. Do you realize how many novelists, writers, poets, musicians, painters, playwrights, composers, sculptors, photographers, and artists could make the same argument when their works are attacked as pornographic by others? I can only conclude that you have no objection to your children reading, viewing, and hearing their works as well. After all, you have already admitted you don't mind your child reading the word "piss" in Sunday School as long as it is viewed in context and "providing that he is taught why these words were used." Shouldn't those whose works you and your compatriots attack be accorded the same opportunity to explain and justify their product?
That the writer "resorted to" this defense does not make it any less valid; but I doubt if any of the supposed writers, poets, etc. using words like "piss" today in their works use it for the same reason the KJV did, or that the writers of the original Hebrew did -- that is, because it was a word that was simply the one used and was not offensive to anyone in that period.
As Marvin Wilson reports [Our Father Abraham, 146-7] Hebrew thought and life is entirely different than ours in a vital aspect. Hebrew as a language is not subtle, and does not convey subtle nuances of meaning (it has only two verbal tenses). "The Hebrew authors of Scripture were not so much interested in the fine details and harmonious pattern of what is painted as they were in the picture as a whole."
Given this mindset, the earthiness of such passages that speak of "dung" and "piss" are what we would expect and are not to be regarded as offensive. "Such vivid biblical imagery reminds us that the Hebrew people lived close to nature; they were not afraid to face head-on those areas of life that people in the Western world normally either mention euphemistically or avoid discussing altogether." 
In contrast, writers, artists, etc. today tend to purposely choose words specifically because they will shock or offend. The comparison is one of apples and oranges.
Ezek. 4:12 Eat the food as you would a barley cake; bake it in the sight of the people, using human excrement for fuel.
The critic describes this as "repulsive," which is a fine statement from someone who has available gas and electric stoves and BBQ grills and has no notion of the expediencies ancient societies were forced to resort to in times of extreme poverty and want. The critic is also presuming his own sanitary phobias upon ancient people who had no such difficulties when basic human need became a difficult priority to fulfill.
Indeed, if this is problematic, what of modern "performance art" that uses human dung, and that not even for practical purposes? What of Jonathan Swift's scene of the Yahoos pelting his hero with their feces? What of the fact that even people in America's pioneer days did things like use buffalo dung for fuel, as one source, now offline, said: "Settlers west of the 100th meridian, which is near Cozad, turned to a unique Plains' fuel. French explorers called the animal-made fuel bois de vache wood of the buffalo. Pioneers simply called them buffalo chips.")? Children even used this dung as toys (One source says: "If you think frisbees were invented in the 1960s, you're wrong--by about a hundred years. Children on the Oregon Trail threw frisbee-like devices back in the mid-1800s. But they weren't made of plastic--they were made of buffalo dung.").
Other examples given are offensive actions morally. Here are examples:
Malachi 2:3 Because of you I will rebuke your descendants ; I will spread on your faces the offal from your festival sacrifices, and you will be carried off with it.
Is. 3:17 (KJV) Therefore the Lord will smite with a scab the crown of the head of the daughters of Zion, and the LORD will discover their secret parts.
2 Sam. 12:11-12 "This is what the LORD says: 'Out of your own household I am going to bring calamity upon you. Before your very eyes I will take your wives and give them to one who is close to you, and he will lie with your wives in broad daylight. You did it in secret, but I will do this thing in broad daylight before all Israel.'"
Critics find such passages "revolting," "disgusting," etc. -- but what is at work here? We see a judgment from God; the question is begged by the critic: "Is this deserved?"
The punishment of course may be figurative in some verses -- Malachi puts the "disgusting" phrase in parallel with the punishment of rebuking and carrying off. The "disgusting" phrase is used figuratively for embarrassment, which this literal action was meant to do. Isaiah's passage may be regarded similarly, since it refers to corporate Israel and their prostitution with other gods. The 2 Samuel passage, contrarily, represents a literal judgment from God.
Nevertheless, if a critic offers nothing but argument by outrage (Link 3 below), that is not sufficient; it must be shown that the punishment does not fit the crime.
Then we have verses like this one:
Ps. 137:9 Happy shall he be, that taketh and dasheth thy little ones against the stones.
Barbaric? As noted above, this is partly answered by noting the frankness and openness of the ancient mind. Actually we do think such things often today (lest it be said, "Well, we're more advanced than those barbarians!"), if only fleetingly, and seldom repeat them in polite company.
At any rate, such are simply typical expressions of Oriental imprecation. Rihbany (The Syrian Christ, 92ff) gives more modern examples: "May God burn the bones of your fathers"; "May your children be orphaned and your wife widowed", and so on. Such wishes were expressed in clan fights and quarrels in Rihbany's native Syria; and yet: "...the Syrians are not so cruel and heartless as such imprecations, especially when cast in cold type, would lead one to believe." Such petitions actually serve a purpose as a "safety-valve" through which the Oriental vents his wrath.
Further: "As a rule the Orientals quarrel much, but fight little. By the time the two antagonists have cursed and reviled each other so profusely they cool off, and thus graver consequences are averted." The Anglo-Saxon social order being more complex cannot resolve things so simply; yet the Oriental shudders at the Anglo-Saxon ready resort to fisticuffs.
Who's the barbarian after all? All of us! For comparison, sci-fi fans may consider Alan Dean Foster's book, Quozl, which depicted a peaceful society of beings who vented their hostilities through art with blood-curdling scenes of war.