People will always be getting sick and always needing treatment by doctors. In fact with an increasingly aging and frail population (which not only requires healthcare for longer, has increasingly complex healthcare needs and will more frequently require healthcare interventions), there's probably going to be more demand in future rather than less...unless you have some other explanation to square away the continual reports of "NHS under strain for demand for services" with your assertion (which I think is taking certain specific matters out of context and generalising it incorrectly) that there aren't enough jobs for doctors (even ignoring the fact that it is in a number of specialties possible to move to other countries to continue practicing if you decide the situation in the UK really is bad).
As I understand the issues around medics getting jobs for the most part have in most cases much less to do with the demand side of what is required to meet the healthcare needs of the country - it's from the supply side of the NHS (or rather the government via the NHS) funding those services and creating posts sufficient to provide them. Outside of a couple of anomalous outliers (neurosurgery and cardiac surgery being the major ones, for various reasons), there is certainly demand for most medical specialties at the consultant level, but poor funding models for GPs, lack of training posts being created for areas in need of consultants like radiology and neurology, and issues with bottlenecks in training for areas like anaesthetics contribute to the challenges in pursuing the career.
Outside of those handful of areas, there is definitely a need for more consultants in most specialties - some may be a bit more competitive in certain regions but if you're able to move to some extent I imagine for most specialties it's probable you could find a consultant post. GP is probably a more complex picture, and the aforementioned cardiac and neurosurgery have more trainees than consultant posts.
Also worth noting that while competition ratios are often high for many specialties, many of those specialties still routinely have unfilled posts in the end - this is due in part to medics applying to multiple specialties at once which drives up the competition ratio i.e. applicants per post, but ultimately they will only accept one post. So the actual picture for recruitment in some specialties may be less gloomy than competition ratios suggest. Of course some have high competition ratios and fill most if not all posts routinely and so genuinely are competitive.
Pay is a bit of a complicated one I think, but it's worth looking at things in context. While yes, doctors (particularly junior doctors) have seen a real pay cut over the last ~14 years or so of austerity and inflation (which is why junior doctors are striking for pay restoration to equivalent levels), and relative to the length of their academic training and their responsibilities the pay especially for e.g. foundation doctors is quite low compared to what you might expect. But due consider this against the bigger picture: medicine currently (just about, unlike pretty much any sector, guarantees a job on graduation, and that job has guaranteed pay progression each year if you continue progressing through training directly (which granted, does not always happen like that!). The salaries for consultants are also more than enough to live comfortably on in most areas of the UK outside of very expensive cities like London, Cambridge, Bristol and the like. No, you probably aren't going to be living in a mcmansion and driving a sportscar most likely - but that's true of the vast majority of graduates.
It's also worth grounding this against the reality of employment in the computing sector - it's very competitive now, simply having a CS degree absolutely will not guarantee you a job in the sector at all on graduation, much less an extremely high paying one, and many roles do not pay eye watering google level salaries. Plenty of CS grads are going to go into much more "routine" roles at lower pay points, and due to the continued myth of CS having great job prospects (when in reality they were so bad for so long, the government commissioned two inquiries into the matter), the market for graduates who could go into those roles is very saturated.
Realistically if you want to go into medicine for other reasons, it also still offers a relatively secure job plan with good long term pay and benefits (the latter not to be ignored - the NHS has a very good pension scheme which is worth real value in the long run, whereas private sector roles will have much worse pension schemes and require a comparably higher income to match what you would get out of an NHS pension) outside of a couple of small areas. However by all accounts the years as a junior doctor seem very challenging and require a lot of commitment and some self-sacrifice. Whether that is something you feel is an acceptable trade off is up to you - and for some people its not (and they would be better pursuing other areas as a result!).