In his book, The Spirit of the Laws (actually De l'esprit des loix), Montesquieu defines his concept of the "spirit of the law" as the underlying social and cultural traits that drive a nation toward one sort of law versus another.
He believed that different cultures have tendencies toward republic, monarchy or depotism in varying degrees, referring to the "spirit of republic", the "spirit of monarchy", and the "spirit of despotism" in various cases. He considered Europe to be uniquely motivated toward liberty, especially his home of France in particular. He attributed much of this variation to features of the natural climate, attributing virtues of action to cold places and virtues of contemplation to hot places. While climate surely does influence the development of a culture, today Montesquieu's particular theories seem rather strange.
Montesquieu also sometimes used the term "spirit of the law" in a narrower (and more modern) sense of the intent of the law, as opposed to the "letter of the law" in all its technical details. The spirit of the law is in effect what it should have said, as opposed to what it actually did say.