For most colleges reaching level 4 of a foreign language is sufficient. Confirm with your guidance counselor and Spanish teacher that the classes you have taken do equate to four years of HS level Spanish. In general AP is considered Level 5 so you are probably fine. If so, I think you are fine to drop Spanish and take a preferred academic class.
@menloparkmom I respectfully disagree with your comment that colleges don’t ever look at middle school – I think it depends on the school system. In our public schools some students take HS level classes in middle school and those classes do appear on the HS transcript. For example my D took HS level math and Spanish in middle school and the grades were on the transcript sent to colleges and did figure in her GPA. Students and parents were made aware of this when students placed into the HS level classes in middle school.