I can understand your frustration having had a similar situation when my dad passed away. He was receiving retirement benefits and passed away on December 23rd. Since he wasn't alive for the entire month the bank had to return his benefit check. It didn't matter that he accrued bills for 23 days of the month and my mom still had a mortgage and needed to eat, he wasn't eligible and my mom had nothing to live on that month. The following month she was eligible to collect his benefits but that was a full month with no income at all.
I could find nothing that stated the confinment had to be 30 days but did find the following on Social Security's website.
Social Security benefits are not paid for the months you have been sentenced to a jail, prison or correctional facility or confined to certain public institutions for committing a crime. And, no benefits can be paid for any month in which you violate a condition of your probation or parole.
Although you cannot receive monthly Social Security benefit payments while you are confined, your spouse or children can be paid benefits on your record if they are eligible.
After arguing with Social Security over my father's benefits this is how I interpreted this: Any part of a month affects the entire month. Since his confinement was part or 2 months they considered each month separately and considered it to be 2 full months. If he was getting any benefits for dependents such as children or if you were also collecting benefits based on his work history those benefits would have been paid.
Is that fair, no way. You could try contacting your congressman to see if there's anything they could do on your behalf.