The first context in which the Torah uses the term hametz is Pesach Mitzraim, the first passover observed in Egypt. There, the Israelites are commanded to slaughter a sheep an eat it with matza (shmot 12: 8) and not to eat any hamtez for seven days (Ex.12:15) then and in future generations. The Torah offers no reason for this law, only that it is "pesach hu lashem". The Israelites are not eating matza because it is the bread of our affliction (lechem oni) nor because we left Egypt in a hurry, but only because it is some how connected with this being a pesach offering. So too the wearing of ones belt and shoes and carrying ones staff (12:11) is not to facilitate leaving in a hurry (we only left the much later, the next morning) but seems to be a part of the pascal service. These laws seem to be intended to get a person to eat while standing, or possibly dancing. The instruction to eat the food "behipazon" could also be related to a kind of dance. In fact the whole word "pesach" usually translated as passed over really means to skip as in a dance.
G-d skipped over the homes of the Jewish people in Egypt. This does not mean that in his travels past houses when deciding whom to kill, he did not check to Jews. G-d does not need to make a visual survey in order to decide. Rather the phrase means that He actively danced and skipped above the doorposts. The blood on the door posts is like the blood smeared on the side of the alter in the Temple. It is part of the sacrificial service. We know from the prophets of Baal on Mount Carmel that the word pesach describes the dancing behavior of priests after a sacrifice has been given. The Egyptian first born were not spared because they had not performed the sacrificial ritual. As such the story can been seen as a vindication of the need to sacrifice the first born, or in its later form, sacrificing a sheep in the place of the first born. The Egyptian first born death is the result of not fulfilling (and not even knowing about) the need to sacrifice the first born.
The eating of matza and banishing of all chametz is one more element in the sacrificial service. We read later is shmot (Ex. 23:18) "Do not bring the blood of my sacrifice to the altar on hametz." In other words, G-ds sacrificial altar should be clean of hametz. and Further, Ex. 34:25 Do not sacrifice on hametz the blood of my sacrifice (though this passage is refering to the pascal offering specifically whereas the first quotation is more general .) But Vayikra really makes clear the direct connectiopn betewwn hametz an d the altar No grain offering that you bring to the LORD shall be made with hametz (leaven), for you shall burn no leaven nor any honey as a food offering to the LORD. (Lev 2:11) see alo Lev 6:10 Only the shlamim (lev 7:13) should be chametz, but that is because it was eaten oiutside the temple as wwell. And the bikkurim of shavuot were also hametz (lev 23:17)- Every mincha offeruing a
There are only two contexts where the concept of hamtz exists at all. One is during the week of passover and the other is on the alter. This leads to the possibility that passover is the turnign of the house into an altar. the bringing home of the altar. We know of matzza as the bread of our afflication, since we ate it as slaves in egypt, we also know it as the bread of our freedom since we ate it on the way out of egypt but there may be a third symbolism connected to matza. It is the bread of G-d altar. It represent the renewal of spring, the spring time agricultual festifavl, where we clean our house and turn it into G-d altar. It represents then a purification of our lives at the start of the new agricultural year.