Yes, you can compost leaves that have been sprayed with bug spray. The bug spray won't harm the composting process, and it will help kill any pests that might be present.