What external monitor and size combinations provide best scaling on macOS?
I had to make a similar decision for myself. In summary: after lots of researching and testing, I found an LG 27 inch 4k display to be the best balance from price/performance point of view for now. I tried to explain in following sub-topics:

Ideal PPI for laptops and desktop screens are different

First of all, Apple adjusts its desktop monitor default PPI values to look like 110 PPI, however for laptops, they tend to use higher PPI values. For example:


Default scaled resolution for Macbook Pro 16 is 1792x1120. On an 16 inch display, this results in 132 PPI. 
Default scaled resolution for current Macbook pro 13 is 1440x900, which results in around 128 PPI on 13.3 inch screen.


Therefore, you should first accept the fact that, on a large screen, expecting the same PPI values (thus same size of fonts) as the macbook screen won't be an ideal solution (unless you have eagle eyes). After that point, you should be hunting for a display, which would give you a good scaled resolution which gets closer to 110 PPI. 

On a desktop screen you should aim for something between 90-110 PPI

If you follow Apple's desktop scaling habits, ideally, you would like to get that 110 PPI on a non-scaled, pixel doubled 
resolution. This means that, if the screen resolution is X by Y, when you calculate the resulting PPI for X/2 by Y/2 resolution on particular display size, you should get 110 PPI. This is called the pixel doubled HiDpi mode. 

However, one of the most popular size: 24 inch 1920x1200 16:10 aspect ratio monitor is 94 PPI. This size has been very popular for productivity. Therefore, we can assume that anything between 90-110 ppi will be good. 

Using the pixel doubled mode will have two benefits:


The text on the screen will be sharpest, because MacOs will use exactly 4 pixels to render 1 pixel of graphical elements.
It will put on the least amount of stress on your GPU and CPU, which will make the computer run much cooler/quieter and all the gui animations to run smoothly. This is especially important if you have an older mac. 


27 Inch 5K is the best, but not widely available

Without no doubt, according to the above criteria, a 27 inch 5K screen, or a 20 inch 4K screen would be the best option. Unfortunately, both options are not available unless you buy an IMac. You can use the DPI/PPI calculator to check the actual PPI values you'll get for a resolution and screen size. Remember to divide the native resolution of the screen by 2 to find out the PPI values which result when the display is used in pixel doubled HiDPI mode. 

Dell p2415q is one of the 4K monitors which come close according to the specs. It is 24 inch and 4K, which results in 91.8 PPI. Since you are already happy with the 1080p resolution on 24 inch display, getting p2415q will be a safe choice regarding sizes of UI elements. However, this monitor has an older design, and reportedly, its compatibility with mac is not very good. You can still try.

Next best option is a 4K 27 inch monitor

On the other hand, you can buy a 27 inch 4K monitor and use it in:


pixel doubled mode 1080p: 81.5 PPI
2304x1296 scaled mode: 98 PPI
2560x1440 scaled mode: 109 PPI


I tried all three of the modes, and from a sharpness point of view, I was quite happy with all of them. However, the sharpness advantage of the pixel doubled mode is definitely perceivable. Since I am using a 2015 macbook pro 13, choosing the pixel doubled mode gives me performance advantage, therefore I use it in that mode. Note that the perceived sharpness difference between pixel doubled and scaled modes will also depend on the distance you will be looking at the display. On that regard, I recommend using the Is this retina? calculation tool. If you will be using the display beyond the distance the monitor's pixel density becomes retina, you will realize less decrease of sharpness in scaled modes. For a 27 inch 4K monitor, this distance is 53 cm. (Right now, as I am writing this, I am looking at my 27 inch 4K LG monitor from 63 cm distance. )

Sharpness depends on how distant you look at

Note that even Apple started to use scaled resolutions on their macbook pro line up in recent years, so as long as you are looking at the display from a distance greater than the retina limit, you should not be afraid of the decreased sharpness. However, the performance drawback of scaled resolutions are real. For example, in order to display 2560x1440 scaled resolution on a 4K display, MacOs first renders a 5120x2880 canvas, then downscales it to 4K. Remember that this is done 60 times each second. I have made lots of tests with Intel Power Gadget to test for the impact, and the result was clearly elevated CPU/GPU temperatures combined with fans spinning in higher RPMs. This tests was on a 2015 13 inch Macbook pro. For newer hardware and/or discrete graphics, your milage will vary. 

Sharpness wise, 27 Inch 5K > 27 Inch 4K > 27 Inch QHD

To sum up, a 27 Inch 5K would be the best. However, 27 Inch 4K used at scaled 2560x1440 will be a lot sharper than 27 Inch QHD monitor when used with MacOS. 

Because of the lack of ideal affordable solution, the best solution which worked for me was to get an affordable 27 inch 4K monitor, at least until 5K or higher resolutions become the standard. 

Consequently, I would not not recommend buying a QHD monitor (2560x1440 native), since you will loose the ability to scale and actual native pixel density will be much lower. I believe modern MacOs versions depend too much on having a dense array of pixels to render text smoothly. 

On the other hand, as an added bonus, Windows 10 scales beautifully with a 27 inch 4K monitor, too. 

Note: I did not put Pro display XDR into consideration, since its price, and requirement for the newest hardware to drive 6K display.