If your Betta was already laying on its side in the cup then he is a sick Betta. This is not necessarily the end of the world but you need to figure out what is wrong with him to treat him, and that is best done in a small tank that you can heat. A filter is not necessary in a hospital tank, but you will need to do lots of water changes to remove the ammonia. Your Betta has a better chance to get well if not kept in a stressful situation. Being moved from the small cup into a tank is already quite scary for him, and when you add tank-mates to the mix it makes things even scarier for him. Do you have a small tank with a heater or can you get one? That would be my first suggestion to help him.
The other option is to bring him back to the store and let the staff treat him. Get yourself a healthy Betta, if that is what you want to add to your tank. Personally I do not recommend keeping Bettas in community tanks. Most Bettas are aggressive to tank mates, maybe not at first but as they mature there may be injuries. Injuries can also happen to your Betta. Feeding can be a challenge, since Bettas love to eat and may over-eat stealing food from his tank-mates. This can cause constipation and bloat which can cause swim bladder disease. In severe cases it can turn to organ problems and dropsy.
Do you know what your other Betta died of? Once you have a death in your tank you should not add new fish for a couple of weeks. Then there is the good practice of quarantine. Before adding any new fish to your tank, keeping them in a separate tank (quarantine) to observe for any diseases for 5-6 weeks helps to ensure no diseases are brought to your other fish.
I know you did not ask about your stocking but I thought I point some things out to you, the decision is still yours. Clown plecos need a bigger tank (36 inches) especially when there are two. Cory are schooling/schoaling fish and need to be in groups of minimum 6, of the same species!!! Tetras too need to be in bigger groups being schooling fish! Instead of adding a Betta you could add some more Tetras and more cories!?