There's also a kind of neuropathy that older dogs sometimes get that makes it hard for them to control their back legs. One of my elder dogs had it. As far as I know, there's not really a specific name for it, but I was told that it's similar in some ways to Parkinson's in humans. I'm not sure if it affects the nerves in the legs themselves. I think it's mostly in the lower spine, but it affects leg function. With my dog, the symptom was that she would be walking along normally, and all of a sudden, her back legs would just collapse underneath her. Nothing prompted it. It just happened spontaneously. It didn't seem as though it was painful. I never discovered anything that helped it. By the time it started happening, that was kind of the least of her problems, anyway, and it only happened occasionally.
When you mention that your dog sometimes walks sideways, and his tail is sometimes held to one side, that sounds neurological to me. I would pick the vet's brain about it, now that you've tried the Metacam, and see what he thinks about it from a neurological point of view. There may not be anything you can do about the problem, if it is simply a degenerative process that is associated with old age. But it would be helpful if you could resolve whether or not you and the vet think it is painful. As long as it's not painful, you can just support your old guy, like you are already doing, by moving his food upstairs and watching over him carefully.
We had a large Golden Retriever (about 90 pounds) that lost use of his rear legs due to a spinal stroke the vet suspected. He said it could pass, some dogs completely recover. The Golden was about the same age as your guy.
We used swimming (dog paddling) as therapy and he regained use of his rear legs. He could no longer run and play hard, but he could take care of his needs and even come up a few steps (not a full flight, just 4 wide steps up to our deck).
He lived another 1.5 years.
I know mastiffs tend to have hip problems. I know you say your dog doesn't but it may be the start of hip problems. We had a 200lb massive mastiff who developed hip problems. We gave him supplements (glucosomine) that helped him not be so stiff when he got up from sleeping. It really did help. I would suggest that or calling your vet and telling them the meds didn't work and see if they can give your dog something else. Hope he gets to feeling better soon.