Are refried beans supposed to be slimy and nasty smelling?
Soaking beans is a normal practice. While 36 to 48 hours is unusually long, they normally shouldn't spoil in this time. 

Assuming that your beans did indeed spoil, there are different explanations possible. 


you misunderstood the recipe and used canned beans instead of dry beans. You can use canned beans for refried beans, but then you have to leave out the soaking and cooking steps. 
you added something to the beans which bacteria could feed on, for example sugar. While a recipe which recommends this would be an incredibly dumb recipe, there are all kinds of recipes out there, and maybe your paper just printed a bad recipe without testing it. 
you somehow created favorable conditions for bacterial growth. I am not sure if this can happen, but maybe leaving beans out for that long can lead to spoilage if other factors come into play, for example a very hot kitchen. 


If the beans were really spoiled, but you didn't do any of the things above, it is very probable that it was a fluke. Try again, and you can reduce the soaking time. 12 to 24 hours is normal for beans. 

It is also possible that your beans weren't spoiled. When beans are soaked, they can produce both slime and froth. This is a perfectly normal chemical reaction caused by complex molecules found in the beans, and it is not a sign of spoilage. A really strong stink will indeed mean that they were spoiled. But if you are not accustomed to soaking beans, maybe you assumed that something is wrong when you saw the slime, sniffed the beans and noticed their normal smell. It is faint, and to my nose it isn't offensive, but it is different from the smell of cooked beans, so maybe you associated it with "not normal" and therefore classified it as "nasty". I can't tell if that happened or not as I can't smell your beans, but if it happened, don't worry. There are lots of things in the kitchen which seem strange the first time. As for throwing out rotten-smelling food, I'd say better safe than sorry.