Iamjustcurious gave you some sound advice. UTI's can be caused from bacteria being introduced into the vaginal or urethral area. Many sexually active women do have repeated infections as a result of sexual behavior. However, generally the kidneys are not involved. Bladder infections Yes, but kidney, NO. Unless the infection was allowed to fulminate for many months without medication, the chances of it infecting the kidney are rare. Generally a bladder infection in itself is so painful and uncomfortable that to let it go long enough so as to infect the kidney, is almost unheard of.
A kidney infection is usually a systemic problem and not a by product of sexual activity. Not that it couldn't happen, but highly unlikely that it would.
Get off the sexual aspect of the problem and have further testing done to determine whether or not there may be an underlying problem. An infection that severe had to be raging for months to require hospitalization. I highly doubt a bladder infection was the cause of the severe kidney infection. The other way around, possibly, but the kidneys are the filtering system of the body, they are used to eliminating bacteria from the body. When the filtering system is compromised, it's another story and one that needs to be investigated more thoroughly.