I'm reading a paper for Google spanner https://static.googleusercontent.com/media/research.google.com/en//archive/spanner-osdi2012.pdf and one thing that's not clear to me is the choice for implementing both two phase commit and Paxos. The paper states that when a transaction involves multiple Paxos groups, two phase commit is used to complete the transaction. My question is why not implementing two phase commit over those Paxos groups instead of implementing Paxos?
You can find more details and the answer of your question in the Spanner, TrueTime & The CAP Theorem document in the "What happens during a Partition" paragraph.
To understand partitions, we need to know a little bit more about how Spanner works. As with most ACID databases, Spanner uses two-phase commit (2PC) and strict two-phase locking to ensure isolation and strong consistency. 2PC has been called the “anti-availability” protocol [Hel16] because all members must be up for it to work. Spanner mitigates this by having each member be a Paxos group, thus ensuring each 2PC “member” is highly available even if some of its Paxos participants are down. Data is divided into groups that form the basic unit of placement and replication.
Basically Spanner, as most ACID databases, it uses the 2PC ( two phase commit ), and it uses Paxos groups to mitigate the "anti-availability" shortcoming.