OK Oksanaut, I read through the shop manual info for setting up the front axle parts with shims. And in the process I can see what went wrong with yours.
Rather than just copying & posting the instructions from the workshop manual - very complex, and only really useful to a specialist - I'd like to ask some questions and first let you know what kind of job you are looking at. Hoping that Winston1 will read through this & comment as well.
First of all, the problem with your front end looks to be that someone tried to fix it before. Originally there are a number of shims of differing thicknesses, ID, & OD throughout that front axle assembly. I believe that the dreaded "PO" (previous owner) took it apart and got some of the shims in the wrong places. That's why some are cupped or worn. They should fit exactly and they should be flat.
To my knowledge there is no such thing as a cupped or deformed shim in this application. They should be dead flat and of a particular ID & OD. Every single axle on every single tractor is set up with a different group of shims when that axle is originally assembled at the factory. There is a guy on their assembly line who measures each axle and puts them together carefully measuring the thickness of that axle's particular shim pack so that the bevel gears in the front axle will engage correctly. This isn't rocket science, it's just picky work. And it's the same mechanical operation whether you are dealing with a Yanmar FWD or a GM truck....or a hydraulic pump for that matter. It's called shimming for proper engagement.
To get back to proper engagement will require a shim kit - probably several different shim kits so that you can try different thicknesses - plus a micrometer, a dial gauge, and some machinist dye. Plus a well supported clean work bench where you can leave things untouched for days at a time.
The task is to get the proper engagement of the bevel gears so that the centers of the gear teeth on the pinoin gear bear on the center of the gear teeth on the driven or ring gear and that total backlash is in the .005 to .012" range. With any luck and with those tools and kits you can get it right with only a few assembly tries. After that, you will never have to set up shims again when doing a seal replacement. That is, if you don't mix them up.
If you enjoy this type of tedious exacting assembly you CAN get it right again. It isn't hard, but it does take time and patience. It's not the type of job that you can send to a mechanic to do. Maybe an old white-haired mechanic at a transmission shop can be talked into doing it. He would also have the shims and precision tools.
But most mechanics these days simply don't have the time (or knowledge) to set up a set of bevel gears. That is why a mechanic replacing axle seals will take fanatical care to be sure to keep track of all of the shims and replace them EXACTLY where they came out. Yours has been done before by an ignorant mechanic some time in the past, and so you don't have that luxury of using the original parts.
So you need to decide is if you want to do it or not? If you do, we can discuss more on how to do it. If not, I suggest that just assemble it as a 2wd - without any oil - and never engage 4wd. In fact, don't re-connect the 4wd front driveshat. That would work OK, and might be the best solution. Alternately, you could buy a used 240D front axle if you could find one that has never been apart. Then just use this knowledge while replacing the oil seals. That would work too.
Repeat: This is NOT a matter of installing Yanmar parts. The setup is the same mechancal task regardless of who made the parts. It is a matter of setting up gear engagement. The shims and bearings you are shimming are universal parts. Yanmar offered the shims, but of course they cannot tell you which ones to use in your particular axle. The shims for your axle was decided at the factory. You can do what the factory did if you have the time and the tools above. BTW, you can get those shims from any mechanical shim source - I suggest McMaster-Carr.
I spent 30 years as a mechanic before going on to engineering and I love this kind of mechanical puzzle, but it sure isn't for everyone. If you like crossword puzzles and tight tolerance machine shop work you will find the job enjoyable and rewarding. Otherwise.....
So think about it. Ask questions. And if you want to go ahead we can.
Sorry to be giving you this news, look again at the options I mentioned : 2WD or find a virgin axle (even if it does leak).
rScotty