Why aren't the two greatest commandments part of the Decalogue? In Matthew 22:36-40 (NIV) Jesus says:

36 “Teacher, which is the greatest commandment in the Law?” 37 Jesus replied: “‘Love the Lord your God with all your heart and with all your soul and with all your mind.’ 38 This is the first and greatest commandment. 39 And the second is like it: ‘Love your neighbor as yourself.’ 40 All the Law and the Prophets hang on these two commandments.”

These two commandments are registered in the old testament, and can be specifically found in:
Deuteronomy 6:5 (NIV):

5 Love the Lord your God with all your heart and with all your soul and with all your strength.

And Leviticus 19:18 (NIV):

18 “‘Do not seek revenge or bear a grudge against anyone among your people, but love your neighbor as yourself. I am the Lord.

However, none of these commandments can be found in the Decalogue (Exodus 20:1-17), which many claim to be the &quot;moral law&quot;.
How come the two greatest commandments are not part of the Decalogue? Doesn't this show that all the other 603 non-decalogue commandments of the Old Testament shouldn't be dismissed, as the two greatest ones belong to them?
Jesus had a way of calling attention to that which underpinned the Law as the Jews were accustomed to viewing it.  For instance:

“You have heard that it was said to those of old, ‘You shall not murder; and whoever murders will be liable to judgment.’ But I say to you that everyone who is angry with his brother will be liable to judgment; whoever insults his brother will be liable to the council; and whoever says, ‘You fool!’ will be liable to the hell of fire. - Matthew 5:21-22

The letter (of the Law/Old Covenant) kills but the spirit (of the Law/New Covenant) gives life:

Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God, who has made us sufficient to be ministers of a new covenant, not of the letter but of the Spirit. For the letter kills, but the Spirit gives life. - 2 Corinthians 3:5-6

The first and greatest commandment, &quot;Love the Lord your God with all your heart and with all your soul and with all your mind&quot;, summarizes the Spirit of the first 4 commandments of the Decalogue in particular and, since all sin is against God, all 10 in general.  If a person truly loves God with everything that they have they will not be in violation of the first 4 commands which specifically have one's personal relationship with God in view.
The second commandment,  &quot;Love your neighbor as yourself&quot;, summarizes the Spirit of the last 6 commandments in particular.  These commands have to do with one's personal relationship and responsibility under God to our fellow man.  If a person loves God in the fashion that produces righteousness under the first 4 commands they will be able, then, to love neighbors as self and not be in violation of the remaining 6 commands.
Some view the 5th command within the first grouping (vertical relationship), others as within the second grouping (horizontal relationship), and still others as a kind of a hinge between the two.  Regardless of where #5 falls, love for God is critical for it's fulfillment.
In this way all the Law and the Prophets hang on these two.  Thus it is said in 1 John 4:19-21 -

We love because he first loved us. If anyone says, “I love God,” and hates his brother, he is a liar; for he who does not love his brother whom he has seen cannot love God whom he has not seen. And this commandment we have from him: whoever loves God must also love his brother.

The only way to love our neighbor as ourselves (2nd greatest command) is to first love God with all we have (1st greatest command).  The only way to love God in this fashion is to receive the love that God first loved us with:

In this is love, not that we have loved God but that he loved us and sent his Son to be the propitiation for our sins. - 1 John 4:10

The way to receive this love of God is to believe in the Son, to be born again/from above (John 3) and to be indwelt by the Holy Spirit, through whom the love of God is shed abroad in the heart's of men:

Therefore, since we have been justified by faith, we have peace with God through our Lord Jesus Christ. Through him we have also obtained access by faith into this grace in which we stand, and we rejoice in hope of the glory of God. Not only that, but we rejoice in our sufferings, knowing that suffering produces endurance, and endurance produces character, and character produces hope, and hope does not put us to shame, because God's love has been poured into our hearts through the Holy Spirit who has been given to us. - Romans 5:1-5

Therefore:

There is therefore now no condemnation for those who are in Christ Jesus. For the law of the Spirit of life has set you free in Christ Jesus from the law of sin and death. For God has done what the law, weakened by the flesh, could not do. By sending his own Son in the likeness of sinful flesh and for sin, he condemned sin in the flesh, in order that the righteous requirement of the law might be fulfilled in us, who walk not according to the flesh but according to the Spirit. - Romans 8:1-4