This is a difficult question to answer, as the Bible does not directly address the situation. The Bible does contain principles, though, which definitely apply to the situation. First, it should be said that a government should not "punish" marriage. It is strange and seems entirely unnecessary for the government to take away retirement benefits due to an elderly person getting married. If an elderly person needs the income while not being married, there is nothing about getting married that will suddenly cause the financial need to disappear. Whatever the case, though, the law exists, so the question arises: how should Christians respond to this law?
There are two key principles which address this situation. First, the Bible instructs Christians to obey the laws of the government (Romans 13:1-7). The only situation in which civil disobedience is biblically allowable is when the government commands something that God specifically forbids (Acts 5:29). The issue of retirement income for elderly couples is obviously not something the Bible has a command regarding. As foolish and unnecessary as this law might be, it does not contradict God’s Word. Therefore, a Christian should obey it. An elderly couple seeking a "spiritual marriage" while avoiding a legal marriage is seeking to escape the requirements of the law. It is essentially no different than cheating on taxes. We are to obey the law. We are not to seek loopholes that allow us to escape the demands of the law.
Second, there is the issue of faith. If an elderly couple believes it is God’s will for them to marry, and if marriage will result in retirement income being lost, the elderly couple should trust that God will provide for them. It would not be God’s will for an elderly couple to live in poverty and destitution. How would God provide? There are many possible ways: through the extended families, through the church, through other government assistance programs, through a more conservative budget, and so forth. Again, though, the issue is faith. If an elderly couple believes it is God’s will for them to marry, the couple should also trust God that He will provide for their needs.
As sad, strange, and unnecessary as the government laws regarding retirement benefits and marriage are, biblically there is no valid reason to try to circumvent the requirements of the law on this issue. There is absolutely nothing wrong with petitioning the government to get the laws changed, but it is unbiblical to disobey/avoid the governmental laws regarding retirement benefits and marriage. If an elderly couple truly and firmly believes it is God’s will for them to marry, they should do so, and trust that God will provide.