When Montesquieu talks about liberty in this book, he does not mean it in exactly the same way that we (at least in the US) use the term. For him, political liberty does not mean some moral right that we have to enjoy freedom of speech or the right to vote. Instead, he is referring to the ability to do whatever the laws allow us to do. Montesquieu is not asking about whether the laws are just. Rather, he says that we have liberty whenever we are able to do everything the law says we can do.
The aim of liberty is simply to create a more just society. A society is just if the people have liberty. In that way, liberty is an end in itself -- liberty itself is the goal of society. When we have liberty, we are able to feel safe. We are able to feel that the state will not punish us for no reason.