It is actually not very easy to know exactly what caused the 9/11 attacks. Different people have different views on this. The quotes in the previous answer are what President Bush said about the attacks soon after they happened. However, the president did not necessarily know why Al-Qaeda attacked. Let us look at some proposed reasons for the attack.
One reason is the reason given by President Bush in the quote above. This is the idea that the terrorists hate our freedoms and our way of life. In this view, they are attacking us simply because we stand for something that they do not like. This view essentially says that the attacks simply came about because other people hate our way of life and that we, as a country, did nothing to provoke the attacks.
Other people argue that the attacks were about our foreign policy, not about our values. In this view, Al-Qaeda hates America because American foreign policy is offensive to them. They believe that our foreign policy is anti-Muslim. They look to our support for Israel and our support for oppressive regimes like that of Egypt which do not allow Islamists to participate in politics. In this view, the hatred for us is based on their view that we hate them and are hurting them, not on our freedoms and our system.
We do not have any objective way of knowing which of these motives was the primary cause of the 9/11 attacks. It seems likely that both motives do have something to do with the attacks, but it is not possible to truly know which mattered more.