Lamport Clocks cannot order unrelated events. But for higher consistency levels in databases, this is exactly what we need.
The classic solution to this is to extend Lamport clocks into Vector Clocks. As the name implies, these are a vector, where each entry corresponds to a Lamport clock at that server. The obvious downside of this is you need vectors as long as the number of servers, making timestamps considerably more expensive, as well as the inflexibility this implies.
One of Spanner's key properties is External Consistency. This is as strong as it gets. Spanner is capable of correctly ordering all events across the entire system in relation to idealized physical time. It does this through a combination of better than typical physical clock synchronization, and waiting out any ambiguity window as needed. The latter does have a performance cost, but the paper makes the argument such costs combined with consistency are preferable to the subtle bugs developers will inevitably introduce without such.
Another thing in the mix here is Hybrid Logical Clocks, which are an extension of Lamport Clocks that keeps them within some constant of the idealized physical time. This is actually what CockroachDB uses (or at least a variation on it).
To get this stuff to gel in your head I would suggest reading the primary papers:
https://lamport.azurewebsites.net/pubs/time-clocks.pdf
https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.56...
https://static.googleusercontent.com/media/research.google.c...
https://cse.buffalo.edu/tech-reports/2014-04.pdf
There are also a couple educators/experts that have great presentations on this topic material, namely Kyle Kingsbury aka Aphyr and Lindsey Kuper. I apologize for not chasing down the exact talks, but they should be up on youtube and such.