What is going on? You may as well ask. In as much as it's about anything, "The Fountain" is about the many myths cultures have around the idea of eternal life. For the Spaniards, it was a fountain. For the Mayas, it was a tree.
One of the more complex symbols is The Tree of Life. The tree at once represents the tree that would have granted Adam and Eve everlasting life in the Garden of Eden; the Sephirot diagram that's the cosmology of Kabbalah; the sacred fig tree under which Siddhartha attained enlightenment and became Buddha; the Sidrat al-Muntaha that in Islam marks the end of the seventh heaven; and the Norse Yggdrasil, which Odin hanged himself from in order to achieve wisdom. All of these connect the three incarnations of Thomas to the tree, especially in Tommy's pursuit of knowledge, but the Yggdrasil myth seems to especially be of significance since Tom's tree-filled spacecraft looks like the Nordic interpretation of the world. According to myth the first humans were made from the Yggdrasil, and the tree is tellingly said to protect the last man and woman when the world ends. Most wonderfully of all, the Mayan Tree of Life is the Milky Way, where Xibalba is located and Tom journeys. Just as the Tree of Life connects "The Fountain's" triptych, Mayans used trees to symbolize the connection between the Earth, the sky and the afterlife.
But as with Apocalypto, the Maya civilization was gone before the first white man arrived. Apparently filmmakers can't get enough of human sacrifice as a symbolic act.