The first thing to do is to take him to the vet and get him checked out - there might be a medical reason for him doing this. Both male and female cats can develop cystitis and this might simply be a case of, especially at night, that he wakes up, feels the urge to go and simply can't get to his tray in time. If it is cystitis then a course of antibiotics will clear it up quickly.
The second thing to do is to ensure that you thoroughly clean every spot where he's been so that no scent lingers any longer. But don't use ordinary detergent or bleach - you need a specialist enzyme-based cleaner. I find that 'Wash and Get-off' seems to be the best currently on the market for this. I always found one made by Hartz was really good but it just doesn't seem to be available now. This will stop him returning to and developing a habit of going where he's been before.
Thirdly, get some Felaway from your vet too - it is a pheromone based product available as either a spray or a plug-in. Not cheap but worth it for an older stressed cat that gets upset at changes in its routine. I always leave one plugged in in my hall and living room while I'm away. It helps the cat feel re-assured that it really is safe in home, marked territory and it won't feel the need to mark it's territory with urine.
I can appreciate why you don't want him in at night but if he's been used to staying in at night then keeping him out at night could possibly be making the situation worse. It will make him feel insecure and that 'home' is now no longer his territory which could make him want to mark it out as his all the more. Is it possible to confine him at night to somewhere that you can provide him with a comfy warm bed in and a litter tray wthin easy reach but is easy to clean in the event of accidents? A downstairs loo or perhaps the kitchen if you have a vinyl floor? Though I can appreciate that having a litter tray and/or puddles isn't ideal where you are preparing food. A friend found that her conservatory, which had a tiled floor, proved to be the ideal 'bedroom' for her cat when faced with a similar situation.
Linked with this, are you absolutely sure that his home territory isn't being invaded by an intruder? I had a catflap controlled by magnetic keys on my cats' collars which unbeknwonst to me brokedwond and was allowing a neighbour'ss cat to get in while I was out at work! The first I knew about it was when my own cats started to show signs of stress including inappropriate weeing. I took to locking the flap until it could be replaced and they all stopped immediately.
Finally, and I know from experience that this can be so hard but do take him to the vet and check him out for anything more serious. This sort of behaviour can be a result kidney faliure or of tumours in the bladder and/or the bowel which create pressure similar to the urge to 'go' and if this is the cause then they can go dowhill quickly. Faced wth this situation with one of my cats, I reluctantly decided that the kindest thing to do was to let him go quietly and I arranged for the vet to do a home visit and Harry quietly and peacefully went to sleep into my arms. I cried my eyes out but it saved him from any further pain and distress and meant he died at home and in peace.
A similar situation arose later with one of my other cats and I've always regretted that I agreed to one more final operation that showed that the tumour was too far gone to save her and so the vet advised that it was best not to bring her around from the anaesthetic. So in the end she died after a traumatic trip to the vets and being put through what turned out to be unnecessary surgery because nothing could be done. I realised that I'd been clutching at straws and had subjected her to this for my sake rather than her's and I just wish that I had arranged for Cleo to die peacefully at home like Harry. I just hope that when Mollie's time comes - she's getting on a bit too now - that I have the courage to let her go peacefully at home too and don't try and keep her going long after her quality of life has disappeared.
SM