I have a single entry visa and I am travelling to two places in the Schengen area. I am travelling from London to Ibiza to Germany and back to London. Am I allowed to enter Germany directly from Ibiza or not on a single entry visa ?
Travelling to Ibiza will not be considered as leaving the Schengen area. This is because it is a part of the Schengen area (same as the rest of mainland Spain). Thus, you can enter the Schengen area in Ibiza (and therefore Spain) and then travel to Germany all on a single entry Schengen visa.
As explained in Single vs. Multiple entry Schengen visa, for Spain and France? you can travel within the Schengen area and visit several countries with a single-entry visa, as long as you don't cross an external border. There won't be any systematic border check or anybody to stamp your passport on the flight between the Ibiza and Germany. Since you won't leave the Schengen area, you don't need a new entry.
Note however that some territories of the Schengen member states (in particular the Dutch and French islands in the Antilles) are not part of the Schengen area so going there would count as an exit (and you might need a separate visa as well). As @AdityaSomani already wrote, it's not the case for the Balearic Islands (see Wikipedia for more details) so this won't be an issue for this journey.
Finally, the UK, Ireland, Romania, Bulgaria, and Croatia are EU member states but not part of the Schengen area so going there would also make a single entry visa invalid.