Preheat the oven to 350 degrees F (175 degrees C). Lightly grease a 2 1/2-quart baking dish.
Place bacon in a large skillet and cook over medium-high heat, turning occasionally, until evenly browned, about 10 minutes. Drain on paper towels and let cool enough to handle, about 5 minutes.
Meanwhile, cook ground beef and onion in a skillet over medium-high heat, stirring until meat is browned and crumbly, 5 to 7 minutes. Drain. Crumble cooled bacon and set aside.
Combine ground beef mixture, bacon, beans, BBQ sauce, white sugar, brown sugar, ketchup, molasses, mustard, salt, black pepper, and chili powder. Spoon into the prepared pan.
Bake in the preheated oven, stirring once, until thickened and bubbly, about 1 hour.