The centre-back caused a stir when he left Anoeta to join Basque rivals Athletic Bilbao in January as a replacement for Aymeric Laporte, who had joined City for a fee of €65 million (£57m/$76m).
Martinez had himself been linked with a move to the Premier League club, while it had looked likely he would join Barca in the previous transfer window only for the deal to collapse at the last moment.
The 27-year-old thinks the interest from Camp Nou cooled because of "internal" disagreements at the club, but he has laid the blame for his failed City switch at the feet of Aperribay.
"You see they [City] are really interested, they give the 'okay', but strange things happen," he told Diario de Gipuzkoa . "You're already pissed off and you wonder if it's chance. Well, no, it wasn't chance.
"The same thing happened with Barcelona, it seemed. If I was annoyed before, that finished me. The 'no' from Barcelona wasn't because of a Real issue, although they tried, but because of an internal issue at Barca.
"Here, though, the non-consideration on City's part was motivated 100 per cent by some position at Real that I prefer not to comment on."
Martinez's reported €32m (£28m/$37m) switch to Athletic caused great bitterness at his former club, who offered fans the chance to exchange any shirts bearing the player's name for a new jersey with the name of their choice.
Animosity among fans was increased when Martinez claimed he could not refuse the salary increase offered by Athletic and took a swipe at Sociedad's ambitions, adding: "I'm going to a big club; here, it's not enough to finish mid-table."
Now, the Spain international says he was also motivated to leave the club because Aperribay did not do enough to convince him to stay.
"He knew what might happen and it seemed as though he was the only person who didn't know or didn't want to know. He spoke to my people as if nothing was going on," he explained.
"It was another case of feeling deceived because at no point did he say: 'Let's get together tomorrow and talk'. Elsewhere, he was saying how important I was and how much he wanted me to stay, that I was a pillar of La Real… but in the end it was just talk and he didn't do anything. Or he just buried his head in the sand.
"But it was another kick in the arse because I could see that he wasn't going to do anything to try and persuade me to stay at Real Sociedad."
Martinez added: "He closed the door on me when he had always said that, if an offer came in, he'd listen to it. He didn't keep his promise and that annoyed me. I could see that the way I was being treated was completely different to other players.
"You take these things on board and there comes a moment when you have to make a decision. I'm a defender, I came through the ranks and they got a good price for me. Others have left for nothing and they've patted them on the back."