This is governed by Directive 2004/58/EC. There are are three separate points to consider:
- The right to enter Spain.
- The right to reside in Spain for <= 3 months.
- The right to reside in Spain for > 3 months.
Under Article 2(1) you are a "Union citizen" because you are Irish. So anything in the Directive referring to the rights of a Union citizen are applicable to you.
The right to enter
Article 5(1) provides:
Without prejudice to the provisions on travel documents applicable to
national border controls, Member States shall grant Union citizens
leave to enter their territory with a valid identity card or passport
and shall grant family members who are not nationals of a Member State
leave to enter their territory with a valid passport. No entry visa or
equivalent formality may be imposed on Union citizens.
The important thing is that you have "a" valid passport. It doesn't matter what passport it is, as long as you are a Union citizen.
Right to reside for <= 3 months
This is also straightforward. Article 6(1) provides:
Union citizens shall have the right of residence on the territory of
another Member State for a period of up to three months without any
conditions or any formalities other than the requirement to hold a
valid identity card or passport.
Again, you just need "a" passport.
Right to reside for > 3 months
Still possible, but with additional requirements. Under Article 7(1), you need to be one of the following: a worker, self sufficient, a student, or a family member of another Union citizen who is one of those. Article 8 provides that the Member State can require you to register and to provide certain documents. This includes presenting an identity card or passport.
Do I need to physically have my Irish passport with me?
Yes, you should carry your Irish passport with you. Although all 3 of the above scenarios only require a passport in general, they all rely on the fact that you are a Union citizen. Without your Irish passport (or identity card) you won't be able to prove to anyone that you actually are a Union citizen in order to assert your rights.
From a practical perspective, you should also avoid entering Spain (from outside the Schengen area) with your British passport. If you do that, border agents will assume you are a tourist and will place an entry stamp in your passport. If you exceed 90 days in a 180 day period in Schengen, you may be considered to have overstayed. This could cause you problems later. It's better to use your Irish passport to go in and out of Schengen.