In a skillet, cook bacon until crisp. Remove to paper towels to drain; crumble and set aside. Drain drippings from skillet. Brown the beef; drain. Add onion and cook until tender, about 5 minutes. Combine ketchup and brown sugar; stir into beef mixture. Stir in pork and beans and all but 2 tablespoons of the bacon. Transfer to an 8-in. square baking dish. Top with the remaining bacon. Bake, uncovered, at 350° for 1 hour.