327. In the spiritual sense these commandments forbid all longings which are against the spirit, that is to say, those which oppose the spirituality of the church, which relates chiefly to faith and charity. If these longings were not tamed, the flesh left to its own devices would rush into every crime. For it is well known from the writings of Paul that the longings of the flesh are contrary to the spirit, those of the spirit contrary to the flesh (Gal. 5:17). Also from James:
Anyone is tempted by his own longing when he is enticed; then longing conceives and later brings forth sin; and sin, when it is brought to full development, brings forth death. James 1:14, 15.
Also from Peter:
The Lord keeps back the unrighteous to be punished on the day of judgment, especially those who walk after the flesh in longing. 2 Pet. 2:9, 10.
In short, these two commandments as understood in the spiritual sense look to all the things previously mentioned in that sense, which are not to be longed for, and likewise all in the celestial sense. It is superfluous to go over these again.