I lost my passport in which I had a Spanish student visa. After I replaced my passport, I got a Czech Schengen visa, valid for 10 days. When I finished the semester in Spain, I left the Schengen area but they didn’t stamp my passport because there was no Spanish visa in it, and the other visa was already expired. In the future, when I want to apply for a Schengen visa, is this going to be a problem when there's a visa without an exit stamp?
No, you should not have problems just because of that. Based on personal experience Spain border guards are quite lax on stamping passports (in violation of Schengen Borders Code, BTW), and their embassies know that.
Hold on your boarding pass and the evidence of your presence outside the Schengen area (some receipts etc), and present it to the embassy if you are challenged. Schengen embassies generally follow up with you if some extra paperwork is needed (again based on personal experience).