When attacking with a straight punch for example you do not want to enter the opponents space square on. Because the defender can easily counter directly with a strike before you even get your hand out as a guard.
When moving in to his space you should already be in kamae to protect your kuukan. The body moves you forward and you extend the punching arm and hit the opponent.
You should hit through the target and not more. If you put your foot under or behind where uke was standing you are striking too deep. Maybe you unconciously do that because you know that he will step back. In reality you do not know that, so you should train there after.
One way of measuring the correct distance is to lean forward into the strike in a good “punching kamae.” Then bend the striking arm so that the elbow just touch the opponents chest. This is the “correct” distance.