I am travelling from July 1 to July 9 for business and then to Spain, August 24 to September 11 as a tourist. Can I apply for a multiple-entry Schengen visa for both trips? Which would be the member state and can I get visa through the Spanish embassy?
Apply to the country that is the main destination of your first trip.
If you write that you are planning another trip to Schengen, they might be nice and issue you a multiple entry visa, and then you have a visa for your second trip, they might also be less nice and only issue a single entry visa (depending on a lot of factors, your - as I write this, undisclosed - nationality being one, you often need a good travel history to get a multiple entry visa), in which case you'll also have to apply to Spain for a visa for the second trip.
Of course there's also the possibility that your application will be refused.