I don't know much about Egyptian law, but in those systems I'm familiar with, your goal here is to put Royal Jordanian in a position where the burden of proof is on them to show that your visa was not sufficient. This shouldn't be too hard to do, because you had a visa that said literally on its face that it was valid for all Schengen States. So you should submit a claim based on that evidence and ask them to show you the source of the purported requirement to hold a visa from the port of entry.
A relevant quote from the Schengen Visa Code, from Article 2(2):
‘visa’ means an authorisation issued by a Member State with a view to [...] an intended stay on the territory of the Member States of a duration of no more than 90 days in any 180-day period;
There is no mention of restrictions based on the issuing state.
A relevant quote from the Schengen Borders Code, from Article 6(1), which lays down the entry conditions for short-term visitors, and in particular 6(1)(b):
1. For intended stays on the territory of the Member States of a duration of no more than 90 days in any 180-day period, which entails considering the 180-day period preceding each day of stay, the entry conditions for third-country nationals shall be the following:
(b) they are in possession of a valid visa, if required pursuant to Council Regulation (EC) No 539/2001, except where they hold a valid residence permit or a valid long-stay visa;
Again, there is no requirement that the visa be issued by the country whose territory is being entered. Council Regulation 539/2001 is simply the lists of countries whose nationals do and do not require Schengen visas for short stays (since replaced by Regulation 2018/1806). This means that to enter Italy, you must have a Schengen visa that is valid for Italy, which you had. It does not matter that it was issued by Spain.
Another line of reasoning to consider: The ground staff should have checked your documents against an industry-standard database called TIMATIC. There, they would have seen that you require a visa to land in Italy. They would have seen some additional notes about Schengen visas, of which the last is
Schengen "C" type visas must be valid for the visited Schengen Member State. This is specified in the "valid for" field of the visa.
Once again, this shows that your visa was valid. The only requirement your type-C Schengen visa had to meet was that it indicate that it was valid for Italy, which it did.
If I were you, I would look to see whether the Egyptian Ministry of Civil Aviation concerns itself with passenger complaints, or whether there is some other body that does so. Also look at the Jordanian Civil Aviation Regulatory Commission or other official bodies in Jordan that might take interest.
I would write a letter to the airline asking for a full refund (and perhaps other compensation) on the basis that you had a valid visa for your destination. Include a copy of the visa, emphasizing that it says it is valid for Schengen states. It will be their responsibility to show why a visa issued by Spain is not valid for entry into Italy.
You might also consider a social media campaign discouraging people from flying on Royal Jordanian because they do not understand how Schengen visas work. If you start telling people to fly on European airlines instead, you might get their attention.