A PoD in 1902 opens a lot of possibilities. One of the best-case scenarios would be for the current system of election to be put to an end. After the Spanish monarchy was restored in 1874, a two-party system was stablished in which both parties simply ceded the government to the other, and elections were held after the government was formed in order to secure it (that's the other way around when compared to the US, first elections, then government). This system was called "
Turnismo". That system was sustainable as a forced intermediate point so the far-left or the far-right couldn't launch a coup (Cantonalist Revolution and Third Carlist War respectively, 1872). However the system started to crack after the Spanish-American War, or as we say, Disaster of the 98. The governments were weak and a new wave of parties rose to displace them. Eventually the leaders of the two former parties had died in 1897 and 1903. After that, the two-party system began to crack and social tensions rose. We could have Spain put more pressure on Morocco past 1902, partly to compensate the loss of the Empire and partly to use the old strategy of finding problems away so those in the country are forgotten. We could see a repeat of the African War of 1859 around 1904, prior to the Algeciras Conference, which could see Spain gaining Tingitania and expanding the Sahara. Howeber that has a problem as OTL
Tragic Week was caused by a similar event and it polarised the society further. Maybe a further Spanish intervention in Morocco could lead to it's partial allignement with either the Entente or the Central Powers, but even without entering the war that'd be counterproductive, as Spain sold weapons and food to both sides during the war, overcoming it's debts and skyrocketing the country's economy.
Social tensions were still there as 1917 saw a mass strike, a parallel government being proclaimed in Barcelona and a military uprising, but they all failed rather quickly. If Spain somehow doesn't waste it's money surpluss in corruption or useless shit and actually uses it in mechanising agriculture and expanding industry in areas where it wasn't that spread (such as Valencia or Andalusia) a more industrialised Spain could arise. That would have to be coupled with deep reforms literally everywhere, close to those implemented by the Republicans in 1931, but in a more gradual and moderate way, but that would recquire a sense of political unity that Spain lacks. Also worth mentioning the Rif War, in which the military men rose incredibly fast, leading to incompetence which led to humilliating defeat against the Rif tribes. A special case was the
Disaster of Annual in 1921 (yes, we love using the term Disaster), caused by a complete incompetence in the high command which led to a crushing Rifian victory. The chain of command was shacked by that and it eventually resulted into Miguel Primo de Rivera's coup in 1923. That can be partially solved with the extended
Melilla War mentioned in the first paragraph and moving some commanders out of place at a certain time. Adding all of these, we get a relatively stable, democratic Spain with a solid control of Morocco.
Btw, Primo de Rivera's coup was initially to be a transitional government which would call for new elections soon, but he didn't, and the king, who had directly supported the coup, was related with Rivera's unwanted regime which extended in time until he was too ill to govern in 1929. The king's popularity had crashed and the prolonged dictatorship had caused the society to polarise, leading to the creation and rise of extremist parties such as the communist or the Falange (which was created by the dictator's son). When Primo de Rivera died, a temporary dictatorship was placed under Dámaso Berenguer, which is called "the Weaktatorship" as Berenguer barely had any control. His government eventually fell and elections were called in 1931. The disprestige of the monarchy had led to the creation of a Republican Block, that despite actually losing the election to the monarchist, forced the king to flee. Again, society divided itself as the new government was very leftist and a coup attempt in 1932 by José Sanjurjo failed. Then the right won the elections in 1933, the left launched a coup d'état in 1934 which failed but caused the society to divide permanently, then the elections of 1936 were won by the leftist with a very strait margin and a wave of political violence hit the country ultimately resulting in the civil war.
Now, if we add all that has been explained up there into a somewhat decent TL, we get:
- The 1909 Melilla War happens differently under a more aggressive government, likely avoiding the Disaster of the Wolf's Cliff.
- Spain has more control over Morocco and still decides to remain neutral, gaining slightly more territory.
- Spain's neutrality in WW1 awards the country with an expanded economy and a solid weapon industry base.
- The after-war governments do not waste such money and use it to solve Spain's technological retardness compared to the rest of Europe.
- An improved army doesn't fuck up against the Rifians, if such a war ever happens.
- No disaster means no Rivera's coup, so Spain keeps it's democracy and gets rid of heavily conservative times.
- The society doesn't divide as much as did IOTL, likely avoiding the Spanish Civil War altogether and the resulting country would be very similar to France, albeit less industrialised.
So we have a stable, democratic and industrialised Spain by 1939. Some side effects of no Spanish Civil War are a weaker Germany (can't test bombers and weapons there), a stronger Italy (doesn't waste it's army there and doesn't suffer humilliating defeats such as that of Guadalajara), less tensions between the Axis and the Allies (it's not like that can avoid WW2) and a USSR with substantially less hard currency reserves (the gold of the Spanish reserves, the second largest of the world, was given by the Republicans to the USSR in 1936 in order to buy weapons, which didn't work).