York, as England's second most important city during the Middle Ages and as a northern stronghold against incursions by the Scots, required a strong defensive ring. Bootham Bar was one of the original Roman gateways into the city/fortress of Eboracum, providing access from the north, although the present structure is mostly of late medieval (or later) construction. To what extent the Roman-built walls were maintained by the Anglo-Saxons is uncertain, but they failed to prevent its capture by Norse invaders who, however, themselves made effort to restore city defences once they were masters there.
The fifteenth-century city financial accounts show that expenditure on wall maintenance was a repeated (if not huge) item in the city budget. The temporary right to levy murage had been granted by the king in 1226 and repeated at intervals. In 1449 the right was granted in perpetuity. Although Richard III cancelled this on the grounds that the tolls were a disincentive to commerce, he compensated the city with an annuity for wall maintenance. Collection of the tolls imposed on commercial goods at the city gates was, in the fifteenth century at least, often leased out to private citizens, who would hope to make a profit beyond the amount they were paying to the city for the lease.
By the close of the Middle Ages the walls and gates were strong enough, to be a useful defence during the conflict between Yorkists and Lancastrians. For instance, during the rebellion of Lambert Simnel (whom the Yorkists claimed to be Edward V), "the lords Scrope of Bolton and Upsall, constrained as it was said by their folk, came on horseback to Bootham Bar, and there cried 'King Edward' and made assault on the gates, but the commons who were watchmen there well and manfully defended them and put them to flight." [The York House Books 1461-1490, ed. L. Attreed, 1991, vol.2, p.572; language modernised somewhat by me.] Nonetheless, Henry VII criticized the city for not keeping its walls in top condition when, two years later (in 1489), other Yorkist rebels were able to breach the defences and capture the city.
Although towns for the most part tried to distance themselves from the national political conflicts that could erupt into warfare, and although private loyalties varied in the event of such conflicts, York neither surprisingly, nor consistently (opinion within the city being divided and it being politic to give lip-service loyalty to whichever side was dominant at any given time) had Yorkist leanings during the Wars of the Roses. This was most noticeable when Richard, Duke of Gloucester, tried to establish a power base in the north, by winning allies there and showing himself a supportive lord to those under his authority. City authorities prosecuted several citizens for criticizing or slandering Richard, provided military support on occasions of need, and expressed deep regret over Richard's death at Bosworth. Towards Henry VII the city behaved coolly, although cautiously, and looked instead to the Earl of Northumberland for support. The capture of the city in 1489 was aided by Yorkist sympathizers among the citizens.