The puritans are not fashionable. Denizens of the past, they seem deeply strange to us. They lived for and with God. They were grim and earnest. During their brief reign (1649-1660), they banned the stage and demolished "idolatrous" art. Today, with the exception of the odd young poet or group of short-story writers in search of attention, nobody wants to be branded a puritan. A puritan is a censor, a prude, an enemy of the arts.

Nowadays we take our cue from Charles II's 1660 Act of Oblivion and try to forget about the puritans. But if we take a closer look at their effects on our contemporary culture, we might paradoxically find cause to celebrate. The Sale of the Century, which opens next month at the Prado in Madrid, provides an ideal opportunity to ponder this puritan heritage, for it charts the artistic relationship between Spain and England in the 17th century, ending with the event that earned the puritan regime its reputation for philistinism: the sale of Charles I's art collection after the king's execution.

In 1649, with the king dead, the time had come for parliament to draw a line under the civil war and liquidate the assets of the monarchy. A sale was announced, a board of trustees appointed to compile an inventory of crown goods, and provision made in Somerset House for their display.

There were of course ideological motivations. Charles and his Catholic wife, Henrietta Maria, had been keen patrons of the arts and selling off their collection would help dispel the whiff of papism that lingered in the king's galleries. But there were also more practical reasons. One thing was as clear to the puritans in 1649 as it is to Charles Saatchi today: pictures can make money. It was recognised from the first that the sale would be more profitable if foreign purchasers were invited to participate.

Among them were Philip IV of Spain, Cardinal Mazarin, Archduke Leopold Wilhelm of the Austrian Netherlands and the wealthy German banker Everard Jabach. With the help of his ambassador in London, the Spanish king secured some of the best works on offer. A sizeable portion of Charles I's collection became the basis for the Prado museum, including such gems as The Virgin and St Elizabeth with Jesus and the Infant St John the Baptist by Raphael, and Titian's Emperor Charles V with a Hound.

But were the puritans really enemies of the arts? Certainly, as part of achieving the nation's spiritual regeneration, Cromwell's government came up wih a legislative programme that withdrew traditional and popular pastimes (Maying, bear-baiting and morris dancing) and also - in part because it had been sponsored by the now defunct Stuart court - the stage. The new cultural prohibitions gave rise to one of the most powerful myths of the Interregnum, that which contrasted Stuart mirth with puritan sourness. But the Commonwealth was not without artistic aspirations. Oliver Cromwell may not have been a patron on a scale to rival Charles I, but neither was he a frenzied iconoclast.

He chose to install himself at Hampton Court, removing the palace from the sale of the king's estate and preserving it for the Commonwealth. He also intervened in the sale of the royal art collection, retaining such masterpieces as Raphael's cartoons of the Acts of the Apostles (now in the Victoria and Albert museum) and Andrea Mantegna's nine-canvas picture cycle The Triumph of Caesar. It is possible that the Protector and the King shared something of the same taste.

They were certainly united in their belief that works of art were necessary adjuncts of political greatness. Cromwell's love of music illustrates the contradictions of his regime. Music in places of worship was anathema to the puritans, so the organ was removed from Magdalen chapel in Oxford - but only so that it could be transferred to Hampton Court for the Protector's delectation.

Indeed, it was in the domain of music that the puritan era made one of its greatest contributions to the arts in Britain: the staging of the first public operas. An important aspect of Cromwell's court was the regal splendour of the feasts given not only for visiting ambassadors but also to celebrate the weddings of Cromwell's daughters, who both married into the old nobility. At the 1657 wedding of Lady Mary Cromwell, the poet Andrew Marvell staged a pastoral entertainment in which, surprisingly, Oliver Cromwell himself is thought to have played the non-vocal part of a benevolent Jove.

In the context of its staging at Hampton Court, the performance echoes the magnificent Stuart masques of preceding decades. It also hints at a compromise between puritanism and the stage, with music used as an excuse for acting. The theatres were first closed by parliamentary order in 1642, and not officially reopened until 1660. The civil war was widely interpreted as God's punishment for the nation's wickedness, so pastimes regarded as ungodly and expressive of "lascivious Mirth" were to be suppressed to encourage repentance. But cultural reform on a national scale is not achieved overnight.

Many ordinary people, even if they had little affection for the executed king, none the less regretted the period when "traditional liberties" had been permitted under the Stuarts. Cromwell's regime badly needed a form of popular entertainment to placate the masses, but its more austere supporters would never tolerate the reopening of the theatres. Caught between a rock and a hard place, the Protector must have felt that God was on his side when, in 1654, a pamphlet dropped on to his desk, offering a way out of this impasse. It was entitled A Proposition for Advancement of Moralitie, and its author was William Davenant, Charles I's poet laureate.

The self-described natural son of William Shakespeare, Davenant had his first plays performed in the late 1620s. In the 1640s, he loyally assisted the Stuart war effort, until he was captured by parliamentary forces and only narrowly escaped the death penalty. Freed, Davenant faced a conundrum: he was a playwright in a land where plays were no longer permitted. What to do? Masques, a court pastime since Elizabethan times, had always combined music and drama, but these were rarefied, allegorical entertainments.

In Britain, no one had yet attempted opera - a narrative told through words set to music - although such entertainments were well established on the continent. Davenant grasped his chance and used his pamphlet to extol the virtues of opera, which, he said, unlike the "lewd" and "effeminate" prewar stage, could be used to teach the people obedience to the puritan regime and promote nationalism.

The birth of the new medium also meant that public entertainments might be resumed without the Protector appearing to have reneged on his commitment to the suppression of lascivious plays. There is no record of Cromwell's reply to the pamphlet, but Davenant, who was no mean political fixer, went ahead with his plans anyway. And so, in 1656, the first English opera - The Siege of Rhodes - was played before a paying audience at Rutland House in London.

No puritan troops turned up to stop it, and the show proved so popular that Davenant wrote a sequel - The Siege of Rhodes, Part II - as well as two jingoistic dramas promoting Cromwell's foreign policy, The Cruelty of the Spaniards in Peru and The History of Sir Francis Drake. Cromwell died prematurely in 1657, and it became clear that a restoration of the Stuarts - and with them all the traditional British liberties, including the stage - would soon follow. And so opera in English was born, an illegitimate child of the puritan decade. Like many of his compatriots, following the Restoration, Davenant was much preoccupied with the events of the preceding years, and so began to stage works that reflected the recent political traumas.

However, instead of writing original plays, he chose to adapt Shakespeare's, ranging from that excellent regicidal text Macbeth to the acerbic anti- puritan "problem play" Measure for Measure. As a result, Shakespeare's plays were the first to pass into the repertory. There had been no such thing as a theatrical "repertoire" before the civil war; old plays were rarely revived. In the 1670s the remaining core of puritan militants emigrated to America. But did they leave a legacy to the arts in Britain? If so, it may well be, paradoxically, that it is most evident in the theatre.

The puritans' objections to the theatre were rooted in a dislike of sham, sensuous spectacle that could distract one from God and in a horror of imposture, of pretending to be someone you weren't.

Puritan attitudes challenged the very basis of any theatrical representation, and in many respects this dislike of "pretending" or impersonation and mistrust of seductive images has been appropriated by theatrical radicals. Whenevever dramatists have wanted to reform the stage, they have invariably used the language of the 17th-century iconoclasts. For instance, at the end of the 19th century, declaring himself "a Puritan in my attitude towards Art... as fond of fine music and handsome building as Milton was, or Cromwell, or Bunyan", George Bernard Shaw announced his intention of curing the contemporary theatre of its empty sensuousness in order to concentrate on ideas and emotional truth.

Similarly, the ascetic puritan aesthetic returned with the experimental British playwrights of the 1950s at a time when the theatre was liable to decorate itself and use the stage - predominantly picture-frame stages - as a picture, lovingly reproducing conventional everyday settings, shamming "reality". In contrast, Harold Pinter and Samuel Beckett provided the sparest of stage directions - in Waiting for Godot "a tree, a stone".

Less was now more. They were interested first and foremost in the dramatic power of language. Puritanism was the religion of text, the obsessional scrutiny of the scriptures and of divine providence which, since the Fall, we may only see "through a glass darkly". Overall, the legacy of the puritans is perhaps a radical questioning of the uncertainty of language and images, and of the dangers of interpretation. In this way, the puritans have furnished us with our critical gaze - a questioning outlook on the arts, what the French would call un certain regard.

· The Sale of the Century: The Artistic Relationship between Spain and England, 1604-1644, runs at the Museo Nacional del Prado, Madrid, from March 14 to June 2.