There were many more modern planes in service back then, such as the Spitfire and the Bristol Bow Fighter, that may have been more appropriate. I just can't see why they would use such outdated equipment to sink such a modern battleship.
So there are a few misconceptions to clear up that I think get to the heart of the question!
Bismarck was not sunk by British aircraft. She was rendered a burning wreck in a surface action with British warships and that damage combined with intentional scuttling by her crew resulted in her sinking.
As part of the attempt to track Bismarck's attempt to breakout into the Atlantic she was tracked by a number of British units, both visually and by radar while attempting to stay out of engagement range. While multiple task forces were directed to close in on her. These included the aircraft carrier Victorious, fresh into service and escorting a convoy. And the carrier Ark Royal, previously serving in the Mediterranean. Following the Bismarck and her escorting cruiser's sinking of the British battlecruiser Hood, these efforts took on increased urgency. While lighter British ships could keep tabs on Bismarck's movements they risked destruction if they engaged too closely and the German ships might escape back to port or get at a convoy, unless the battleship could be slowed by attack or damage to allow the British trap to close.
To support this both Victorious and Ark Royal launched air strikes from their embarked air wings. These were comprised of what aircraft were aboard. Including the Fairey Swordfish's at question here. On May 24th in late afternoon Victorious sent 6 Fulmar fighters escorting 9 Swordfish torpedo bombers. After misadventure in almost attacking friendlies they reach Bismarck. 8 of the torpedoes were misses, 1 did hit but did very minimal damage when it hit her armor belt. However the aggressive maneuvering mad existing flooding and leaks worse from her battle with Hood and Prince of Wales. This forced the evacuation of part of her engineering spaces and reduced her speed.
The famous attack then comes 2 days later, after the first attack Bismarck had managed to break contact from her pursuers and the hunt reached frantic efforts to find her before she could get to port or under the range of German shore based air cover or protection by U-Boats at sea. After being sighted again by aircraft, and following 1 botched attack again with friendly fire, Ark Royal, whose task force was the closest and last best chance, sent up 15 Swordfish in the early evening of the 26th. They scored 2 hits, 1 was again well contained by her armor belt, but the other damaged her port side rudder and jammed it at 12 degrees, meaning she was essentially stuck in a wide turn, not easily corrected by her other rudder or multiple propellers. Overnight British forces closed in and the battleship was sunk the next morning.
Now as to the question of what the Swordfish was doing being in the attack?
Well it was still the frontline Torpedo Bomber of the Fleet Air Arm in Spring 1941! Aerial torpedoes are big, heavy, awkward things, meaning aircraft generally need to be specially designed to carry them. Doubly true for single engine strike craft that are expected to operate from carriers. The Swordfish, while slow, and aging, was still rugged, mostly reliable, and most critically, was present in large numbers! While other torpedo bombers that were carrier capable were in service neither was in the air groups of the 2 carriers at hand. The Albacore (still a biplane) and Barracuda, were much newer and had either only started serving at sea, or not yet at all. So it remains a function of which aircraft are in sufficient numbers and ready to serve at sea, and which carriers were on hand to have their air wings refit, recall that Ark Royal had been operating out of Gibraltar the past few months!
As to why the Royal Navy and FAA didnt have anything else? Its a bit of a tale, and not all of it concerns the question here. But until just before the war the Royal Navy didnt actually control its own aircraft, their design, or procurement! The FAA from the mid 20's until mid 1939 was simply a branch of the Royal Air Force. This has severe consequences for things like development of new aircraft, budget constraints, and doctrinal organization. This meant that despite appearances, the Swordfish was probabaly in the top 3 for most effective aircraft the FAA had in the inventory in 1939, compared to some absolute duds like the Skua.
/u/DBHT14 has cleared up some of the misconceptions in the question, as well as giving some idea of why the Swordfish was used. However, they haven't told the full story of the mess that was British carrier aircraft procurement in the interwar period, which explains why the Fleet Air Arm was left with obsolescent (or seemingly obsolescent) aircraft for much of WWII.
The story starts in WWI, when the Royal Air Force (RAF) did not exist. Instead, both the Royal Navy and British Army had their own, integral air branches. For the Royal Navy (RN), this was the Royal Naval Air Service (RNAS), while for the Army it was the Royal Flying Corps. This system worked well for the RN. The RNAS was a highly active, innovative service, which met the needs of the Navy well. However, there were also flaws, especially when looking at the bigger picture beyond the RN. With two separate services performing similar duties, there was a lot of wasted effort. As an example, both the RNAS and RFC had their own strategic bombing programs. The RNAS followed the practice of the Admiralty when it came to procurement, relying mainly on private companies for R&D. The RFC, meanwhile, used the War Office (the ministry responsibility for the Army, much as the Admiralty was responsible for the RN) method. This used government factories and arsenals to do both the R&D and production. These were optimised for production of a large amounts of fixed designs, a system that worked well for small arms, shells and artillery pieces. For aircraft and aero engines, which underwent rapid improvements over the course of the war, the RN's system was far superior. The RFC often found itself short of modern, capable aircraft, or the engines for them. Finally, there were issues of coordination, especially for home defence against German zeppelins and bombers. Zeppelin raids had been carried out against a number of British targets, starting in 1915. These were largely night raids, and were largely unopposed, with relatively few being shot down. From 1917, German heavier-than-air aircraft began to raid London and the south-east of England. These raids were rarely intercepted, and a lack of communication between the RNAS and RFC was a large part of this. In 1916, an Air Board was formed, to coordinate beetween the RNAS and RFC, especially on issues of production. The RN, though, failed to properly engage with the Board, giving Britain's political establishment the idea that the RN was out of touch on aviation, and that the RNAS was being neglected. In 1917, in response to the German bomber raids on London, the South African General Jan Smuts was put in charge of an inquiry into improving the British response. The main conclusion, after the RN had neglected to make an effective case for the independece of at least a part of the RNAS, was that both the RNAS and RFC needed to be combined into a single service. This new service, the Royal Air Force (and its associated Air Ministry), would control every aspect of British aviation, and would be formed on the 1st April 1918.
The formation of the RAF largely destroyed the aviation community within the RN. RNAS pilots who wanted to keep flying had to leave the Navy and join the RAF instead. Those who wanted to stay in the RN had to give up flying and compete for spaces in other specialisations (gunnery, torpedoes, navigation etc) against officers with more experience and training. The technical ratings (enlisted men) faced a similarly difficult choice. Naval officers who were interested in aviation as a part of naval warfare, but were not pilots, were pushed away by the RAF, who preferred to use its own specialists to form doctrinal and tactical planning. The RN did retain control of its aircraft carriers, but had no say in which aircraft flew off them or how they were used. This meant that the RN had few people with aviation experience, little ability to gauge the changing capabilities of aircraft, and no way to test new tactics with aircraft. It was not happy with this state of affairs, and, in the immediate pre-war period, began a process of bureaucratic warfare against the RAF. This culminated in a compromise agreement between the two services, named the Trenchard/Keyes agreement after the RAF and RN officers who were its main architects.
The Trenchard/Keyes agreement resulted in the formal establishment of the Fleet Air Arm (FAA) as the organisation responsible for flying aircraft from RN ships. It was still a part of the RAF, but the RN had much more influence over it. The RN had tactical control over FAA squadrons embarked aboard ships, and could control the training of FAA squadrons when they were disembarked. Up to 70% of the FAA's pilots could be drawn from the RN or the Royal Marines. These pilots would remain part of the RN or Marines, and would be given dual rank within the RAF during their time in the FAA. Naval ratings would be allowed to take over technical roles aboard the RN's ships. Naval officers were allowed to serve aboard aircraft as 'observers', spotting and identifying ships, communicating with RN ships for gunnery spotting, and generally providing naval expertise. Most importantly for this question, though, the Admiralty was given a degree of control over procurement. Under the agreement, the Admiralty was to inform the Air Ministry of the details of the aircraft it wanted - the speed it had to reach, the payload it had to carry, the armament and so on - as well as how many of these aircraft were needed. The Air Ministry was, in turn, responsible for laying out the specification for the aircraft, selecting the best design, and paying for the aircraft.
While this system was better for the RN than the previous one, it had significant flaws. The system of 'dual rank' for pilots significantly slowed down their chances of promotion. The RN's system of promotion was largely based on a combination of sea time and reports from your seniors. A pilot with the FAA would be spending more time ashore, and reports on his progress and quality would be contained within the RAF's system, not the RN's. Observers were entirely within the RN system, and therefore could more easily reach higher ranks, but had less experience with the practicalities of aerial warfare. This meant that the RN was unable to rebuild the aviation community it had developed before 1918. The lack of experience and institutional knowledge was not a good combination when the RN had to set the specifications for its aircraft. The Air Ministry, meanwhile, was unwilling to spend money on naval aircraft. The interwar period was, largely, a period of cuts to defence spending. The RAF wanted to focus on its own theories of strategic bombing, to prove that it could win a war on its own, and therefore wanted to spend its limited funds on new fast bombers. It refused to provide the RN with more aircraft than it needed at a minimum, often with vituperative language. In 1935, Group Captain Arthur Harris (later infamous for his role in the strategic bombing campaign against Germany), responded to an Admiralty paper calling for the production of new smaller carriers for defending convoys, describing it as 'a typical example of the senseless and greedy waste of national resources in purely defensive measures'. Naval aircraft contracts were awarded to second-string companies like Blackburn or Fairey, keeping the better designers free for the aircraft the RAF wanted.
The RN's lack of institutional knowledge led it to put overly stringent restrictions on the aircraft it produced. With limited knowledge of the ability of pilots to navigate alone, it eschewed single-seat aircraft. As the numbers of FAA aircraft were limited by the reluctance of the Air Ministry to spend money, losing a single aircraft would result in a significant loss of capability; losing the aircraft because of a navigational failure would just make things worse. Therefore, every aircraft that would operate out of sight of the carrier would need a navigator; this would also increase the number of aircraft carrying RN observers. As carriers carried few aircraft, they had to be multi-role aircraft. This resulted in compromises which single-role aircraft did not have to make. Finally, to increase the number of ships that carried up-to-date aircraft, the Admiralty set a policy that new naval aircraft had to be capable of being launched from both carrier decks and catapults on cruisers and battleships, operating with either a wheeled or float undercarriage. This was workable with the low-performance biplanes of the 1920s, but as technology improved, became a real drag. The Air Ministry also exerted its influence. It insisted that 'the bomber will always get through', that there was no practical defence against modern bombers. This meant that Admiralty requests for long-range fighters for fleet defence and strike escort were overlooked; to accept them would hurt the Air Ministry's push for strategic bombing. Instead, fighter designs focused on the short-range interceptors that were useful for fighting strategic bombers. The Air Ministry also convinced the government that the RN's carriers would not be needed to attack targets on land. Instead, they would only be needed to engage targets at sea. This meant that the FAA's aircraft would only be engaging other carrier aircraft. These were assumed to be low-performance aircraft, as experience had shown that even these aircraft could be highly effective at attacking ships. As such, the FAA's aircraft could be optimised for flying off carriers, with things like low speed handling being prioritised over maximum speed. The RN, with limited institutional knowledge, was unable to effectively push back against these concepts.
To add on to the excellent posts by /u/DBHT14 and /u/thefourthmaninaboat, here's an older thread explaining why the Bismarck was an inherently flawed design: https://www.reddit.com/r/AskHistorians/comments/4rj4fk/what_were_the_fatal_faults_of_the_bismarckclass/