Why was incest allowed in the Bible?

Why was incest allowed in the Bible? Why is incest wrong now but it wasn't in the early Old Testament? Why did God allow people to marry close relatives?