When there's a goal to go situation and a team keeps making penalty they keep giving them halfway to the goal halfway to the goal penalty now they run out of room there at the goal line. Can the team give up points? What do they do if there's no more room left?
In general, the answer is simply that they keep getting halfway. The NFL Rulebook states (14.2.1):
If the enforcement of a distance penalty would move the ball more than half the distance from the spot of enforcement to the offender’s goal line, the penalty shall be half the distance from the spot of enforcement to its goal line. This general rule supersedes any other general or specific enforcement of a distance penalty.
First and goal on the 1, penalty on the defense, spot the ball on the 1/2 yard mark. Another off-sides on the defense, spot it at the 1/4 yard mark. Eventually a QB sneak becomes basically automatic, I'd say...
The exception would be if the referee deemed the action a "palpably unfair act", which is then covered by rule 12.3.4:
A player or substitute shall not interfere with play by any act which is palpably unfair.
Penalty: For a palpably unfair act: Offender may be disqualified. The Referee, after consulting the officiating crew, enforces any such distance penalty as they consider equitable and irrespective of any other specified code penalty. The Referee may award a score.
If a team were to repeatedly commit fouls, and the referee were to deem the offending team to be doing so intentionally with malicious cause, they could make any equitable repair they chose, including allowing a score. I can't imagine that actually happening in an actual game, however.
Additionally, Phillip points out there's actually a specific rule just for this, 12.3.2:
ARTICLE 2. FOULS TO PREVENT SCORE
The defense shall not commit successive or repeated fouls to prevent a score.
Penalty: For successive or repeated fouls to prevent a score: If the violation is repeated after a warning, the score involved is awarded to the offensive team.