A common mistake in this ignorant and deluded age is to fondly imagine that someone who is out of the state of grace (e.g. living off the proceeds of crime, such as fraud, burglary, embezzlement and the like; living in sin with a girl- or boyfriend or adulterous partner, committing fornication or worse; living as a Neo-Nazi, hating and attacking one's fellow men on spurious and evil pretexts; etc.), if not still daring to receive Holy Communion (which reception would only increase one's damnation, whatever vile liars may claim), could yet piously pray "Lord, I cannot now receive thee sacramentally, yet come at least spiritually into my heart, filling me with thy saving grace" – while remaining unrepentant. Obviously, one would need to repent of one's sins, making an act of perfect contrition (including the resolution to confess sacramentally as soon as possible, and resolving to amend one's life), else such a pretended spiritual communion would in no way help, but rather be an added blasphemy. Of course, persons may vacillate in the spiritual life as in all else; for just as a person may begin to pray in a state of damnation, yet end the prayer in a state of salvation (so says St Alphonsus, evidently alluding to acts of contrition inter alia), so a person having prayed for deliverance may soon enough slip back into evil habits, since vices enslave each unhappy sinner. It is in this sense that the counsel to make a spiritual communion when unable to receive sacramentally must be taken, according to those words "sinking we strive, yet call to thee for aid", hoping that by struggling to hold one's head above water, rescue may come from above, as it were.
2 hours ago