Preheat the oven to 400 F.
In a gallon-sized resealable bag, toss the asparagus spears with olive oil until well-coated.
Place asparagus spears on a baking tray, arranged side-by-side in a single layer. Evenly distribute garlic, salt, and pepper on top of the asparagus.
Bake until the asparagus is tender-crisp and starting to brown, 10 to 15 minutes, depending on the thickness of the spears.
Turn off the oven and remove the baking tray. The asparagus shrinks once cooked, so optionally gather them closer together on the baking tray. Evenly top the asparagus with shredded cheese. Distribute diced bacon on top of the cheese.
Return the baking tray to the oven. Broil until the cheese is golden brown, about 5 minutes, watching carefully so it doesn’t burn.