One of the first commandments given to humanity is 'go forth and multiply' (Genesis 1:28) which is the instruction God gives to mankind at the end of the first creation story. Thus sex is part of God's plan and human sexuality is a part of human nature.
Most Christians regard sex as a gift from God. It's primary purpose is procreation, but it is also to be enjoyed (within marriage) as a way a couple show love to one another. The sexual act is the consummation of a marriage and not having had sex is a grounds for annulment (saying that the marriage never happened).
St Paul said that a married couple had a duty to one another and that they should not 'deprive one another' except 'by mutual consent' and only then for a limited time (1 Corinthians 7:5).
The medieval theologian Thomas Aquinas is closely associated with the idea of natural law. He thought that since the world and everything in it was created by God, it must in some way reflect his intentions. This means that we should be able to use our reason to work out how to behave as God wants us to.
Aquinas deduced five primary precepts:
From these primary precepts we can work out secondary ones. For example, the precept to preserve life means that murder and suicide are both wrong. For this topic, the second precept is relevant.
Aquinas thought that sex is self-evidently for reproduction. The design of the sexual organs and the method of sex lead us to the conclusion that its telos (purpose/goal) is procreation. This means that God created sex for procreation. To use it for anything else is to use it in a way that God did not intend. Thus forms of sex that cannot led to reproduction are against God's will. This would mean that homosexuality goes against God's will.
In general, people have usually viewed heterosexuality as 'normal' and homosexuality as 'other'. This has led people to try to discover what causes homosexuality.
Obviously there have always been people who have been attracted to members of the same sex. However, historically it has often been viewed as one of the following:
Thus those with same sex desires have been either punished or treated in order to try to cure them.
Homosexuality was punishable by death in England until 1861. It remained illegal in England until 1967 and in Northern Ireland until 1982. Men in the armed forces could still be court martialed for homosexual acts until 1991. For many years the age of consent for homosexual sex was higher than that for heterosexual sex and it was only reduced to 16 in 2001.
If we consider the world as a whole, there is huge variety in attitudes towards homosexuality. Whilst many European countries and American states have gay marriage, some African and Middle-eastern countries have harsh penalties for those who engage in homosexual acts. This includes the death penalty in Saudi Arabia, Iran, Somalia, Yemen and parts of Nigeria. In many parts of the world (including in liberal countries which allow gay marriage) people in same sex relationships can be the victims of hate crimes and face homophobic discrimination.
Many parts of the Bible were written within cultures which did not tolerate homosexuality. Consequently, the Bible has a significant number of anti-gay statements. Liberal Christians would regard these as a natural reflection of the views of the people who wrote the Bible, but fundamentalist Christians would regard these statements as reflections of God's will.