If you had a bacterial infection, you will need to kill the offending bacteria still living in the vessel, or you will sour future batches. You may want to bleach bomb the carboy, making sure to rinse several times to remove all chlorine.
Once the bacteria entered the beer, it probably didn't matter that it warmed after cold conditioning. You should determine how it entered the beer. If you rack from primary to secondary, is all your equipment sanitized. Hydrometer thief, racking cane, siphon tube, hoses, etc.? For instance, if you start a siphon with your mouth, that will nearly always cause an infection. Unless the hydrometer and tube are sanitized, don't pour the sample back into the beer. Don't set the airlock stopper on a surface and put it back without cleaning it first. The outside lip of the carboy is probably also hosting a bacteria fiesta. Etc., etc., etc. Beer isn't terribly fragile, but it creates a nice environment to host some types of bacteria.
There are bacteria everywhere in our homes, and, in fact, the kitchen typically has the highest populations. Bacteria can be present on the dust in the air. I am not trying to make you phobic, just pointing out that pinpointing the root cause of an infection can be very difficult. This is one reason many homebrewers avoid a secondary. Every time we fiddle with our beer, we can increase the chances of an infection. Beer is pretty hardy, and if you sanitize well, you can minimize those odds.
Common household bleach is a great sanitizer, but it takes a lot of rinsing to remove all the chlorine. Easy clean and oxy-clean sanitize with hydrogen peroxide, and are generally not recommended for use in the final sanitizing step. They are great, though, for breaking down some of the gunk that builds up inside the carboy. Lots of homebrewers use star-san or iodophor, which are highly recommended as sanitizers. Star-san is my preferred sanitizer- it is easy to mix and use, and I keep a 1.5 liter garden sprayer full of it handy for the in-between sanitizing sessions like hydrometer sampling, etc. It is a wet contact sanitizer with lots of foam. It sanitizes with 20 seconds of contact. It also breaks down into nutrients for yeast.
I'm sorry you had to toss a beer. I know that hurts, after the investment of work, time and money. I hope you have some ideas as to wher the infection may have originated. As they say, sanitize everything that comes in contact with your beer after boiling!