> I wonder how they justified to themselves having slaves while talking about freedom and liberty.
Isn't it pretty clear and straight-forward? It was based on the beliefs (regardless of the degree to which you might think from your perspective that those beliefs accurately represent reality or not) that many people held back then that there are significant racial differences between slaves and people, and the same rules do not apply to white ones as to black ones because they are not the same species, they do not have the same brains/possibilities/rights/etc. Just like they did not grant any freedom to animals or trees.
However much one might disagree with the basic premise of the racist argument, it does not make it a hypocricy freedom-wise. If someone was holding these racist beliefs in this past USA (and many of them did) - they could very well believe in freedom of all people, and at the same time not consider the slaves "people" based on their racist beliefs that there are actual important and significat differences between those races.
Just because someone treats someone else badly doesn't automatically make it a hypocricy, the world is just more complicated than that and there are plenty of examples of violence or exploitation being based on well established logical thought systems or even ethical (from the point of view of the exploiter) beliefs. And this is important because if you want to make a change in a society, you might benefit from understanding how that society actually thinks and what ideology is behind it. Just calling it a hypocricy is not good enough.