God killed Onan for "spilling his seed" on the ground
Examples of the death penalty
The Bible prescribes the death penalty for the following activities, among others:
Murder
Adultery
Bestiality
Rape
Sodomy
Picking up sticks on Saturday
A betrothed woman who conscensually has sex with a man.
A woman who is found not to have been a virgin on the night of her wedding
Worshiping other gods
Witchcraft (Exodus 22:18)
Taking God's name in vain or cursing God's name
Cursing a parent
Kidnapping
Modern view
Some contemporary critics of the bible have viewed its laws as immoral .
Common criticisms include:
The Bible tacitly endorses certain forms of slavery, and records many laws and procedures dealing with slaves.
The Bible's strictures on homosexual sex are seen as outmoded by some groups. As well, the Bible's endorsement of capital punishment and its restriction on adultery are often viewed in a similar light.
On the other hand, more conservative critics are more critical of the Bible's permissivity toward polygamy.
Even among proponents of capital punishment, many of the crimes which the Bible records as punishable by death are not currently regarded as deserving of this penalty.
http://en.wikipedia.org/wiki/List_of_capital_crimes_in_the_Bible