I read that cardinal Ratzinger stated the story in Genesis 1 and 2 should not be interpreted as a literal account of the beginning of things. In spite of recent events like this, they have always been in favour of a literal explanation of creation based on Genesis. This is what I read. Why is it that the Catholic church changed their views on such an important matter?
Ratzinger writes at such length as to obscure the point, in my opinion. If you read the Catechism of the Catholic Church, 283 (2nd ed.), the reasoning is spelled out in a brief and clear form:
That is, they recognize and appreciate the value of scientific studies for the information they yield about matters including the history of the universe and life on earth. This is entirely consistent with their stance that faith and reason can never truly be in conflict (CCC 159):
In this case, the scientific evidence against a literal reading of Genesis is so overwhelming that if truth cannot contradict truth, it suggests that the error is to read Genesis literally. I do not know why it took so long for the Catholic Church to recognize this, but the current position is internally consistent and reasonable.
If they were to continue to insist on a highly literal interpretation, they would have had to drop their position on discrepancies and simply state that faith wins. That would have been a much larger doctrinal change than maintaining (as they do, to my understanding) that Genesis 1 and 2 is spiritually accurate without being a literal account of all events.
More on this topic can be found in a large number of places, including here.
My mother-in-law has that book you link to (she's a very traditional minded Catholic and would be aghast if the Pope invalidated the Genesis account). I read a little of it and it's more or less a collection of meditations written by then Cardinal Joseph Ratzinger, it has no official doctrinal significance and is little more than his opinion. Frankly, I'm aghast that someone could infer from a collection of meditations, written by a man who didn't even really want to be pope, something about Catholic doctrine.
There's a lot more to those answers than just yes's or no's, but it's nice that initially they don't mince the words. I'll leave it to you to get your hands on a YouCat in case you want to know more, just find someone who went to World Youth Day in Madrid in 2011 and they ought to have one in your language.
However, and to your exact point, question #46 has a more nuanced answer. I won't quote it completely since it's copyrighted, but I'll try to give you the gist of it all.
It goes on to give 7 points, which I'll phrase in my own words.
The 7 days account are symbolic of these principles:
Science is not going to inform our theology any more than theology is going to inform science. They're completely separate entities and they tell us completely different thing. Theology is infinitely more important than science since it concerns our ultimate destiny and knowledge of science is not necessary for entrance into Heaven. Science is not the realization of what is hoped for nor the evidence of things not seen. Theology is for the simple (Virgin Mary, St. Bernadette, St. Juan Diego, the 3 Children from Fatima) and it was not incumbent on them to understand complex theological principles any more than it was incumbent on them to understand complex scientific principles to receive God's grace.
If you show me one scientist who fully understands the Big Bang, Evolution and Quantum Mechanics, I'll show you one scientist who fully appreciates God's grandeur in the infinite and infinitesimal.
Finally, I'll leave you with the words of Pope Benedict XVI (in the margin of the YouCat)
2. I was trying to find the source for this and couldn't. But it might be good to consider that he hadn't been pope for more than a week when he said this!