Why a soul needs to be in a state of grace when receiving the Eucharist? What is the reasoning behind the Catholic Church teaching that only people in the state of grace should be allowed to receive the Holy Eucharist?

Lately, I heard a statement:


  The Eucharist: A prize for the just or medicine for sinners?
  
  The Eucharist is no gold star on the forehead of “good” Christians,
  but an undeserved gift to strengthen pilgrims who stumble along
  through life with their gaze fixed on heaven.


What is this teaching based on that one needs to be in the state of grace and why?
1 Cor. 11:27:


  whosoever shall eat this bread, or drink the chalice of the Lord unworthily, shall be guilty of the body and of the blood of the Lord.


The Catholic Haydock Commentary says on this verse:


  Ver. 27. Or
                             drink. Here erroneous translators corrupted the text, by putting and drink (contrary to the original,&nbsp;e
                             pine ) instead of or drink. --- Guilty of the body, &amp;c. not discerning the body, &amp;c.
                             This demonstrates the real presence of the body and blood of Christ, even to the unworthy communicant; who otherwise could
                             not be guilty of the body and blood of Christ, or justly condemned for not discerning the Lord's body. (Challoner)
                             --- The real presence in the sacrament is also proved by the enormity of the crime, in its profanation. See St. Chrysostom,
                             hom. de non contem. ec. and hom. lx. and lxi. ad pop. Antioch. where he shews that the unworthy receiver imitates the Jews
                             in crucifying Jesus, and trampling under foot his sacred blood. Hence the dreadful punishments we read of in verses 27 and
                             30.