The most obvious use, I would think, is to train machine learning model. Not necessarily neural networks, it could be much simpler models. Even if you don't need the data now, it can be useful to store it for later use. Maybe at some point in the future a new model will be able to see patterns that are useful. I think they operate based on the principle that data is a valuable resource, even if not immediately useful. How much data they have about their users is one of their key advantages over smaller players.
In general though, more data about you, such as locations you visit, people you're friends with, activities you do, gives them more understanding of what kind of person you are, which is undoubtedly useful when it comes to try and sell you stuff. For example, think about friends you know really well. Presumably, you have some idea of what kinds of things they would like to buy for themselves. That's because you have a good mental model of what kind of person they are and what they like, what they might be interested in.
Facebook maybe has one big advantage over Google, which is that they are a social network. They can try to influence your tastes based on the idea that you are likely to want to try things that your friends are into. They can subtly or not so subtly show you things your friends are doing with the hope that you will want to try or buy those things too.