what would you want to be a kernel module?
Although most people associate kernel modules (only) with device drivers, other kernel services such as filesystems and network protocol handlers can also be built as modules.
The primary rationale for a kernel module versus static linkage (i.e. built in the kernel) is for runtime configurability (which in turn improves memory efficiency). Optional features, services and drivers can be left out of the kernel that is booted, but can still be loaded later when needed.
The overhead of loading the module, the storage space required by the module (the kernel is usually stored in compressed form whereas the module is not compressed) and the fragment of a memory page wasted by each module are usually considered acceptable tradeoffs.
What kind of tasks are best done as a kernel module compared to using syscalls and doing stuff?
This a separate question not really related to the previous. You should actually be comparing user-mode versus kernel-mode. Whether the kernel-mode uses a module (that has to be loaded) or statically linked code (that is always available) is not a significant aspect to the actual question. (The other answer that mentions a "a small performance penalty when running module code due to the virtual memory overhead" is incorrect.)
A user-mode service or driver has the advantages of:
Usually easier and quicker to implement (no need to build and install the kernel). Most C programmers learn (only) with the C runtime library, so the kernel environment instead of user-mode could be a learning experience.
Easier to control proprietary source code. May be exempt from the GNU GPL.
The restricted privileges are less likely to inadvertently take down the system or create a security hole.
A kernel-mode service or driver has the advantages of:
Availability to more than one program in the system without messy exclusion locks.
Device accessibility can be controlled by file permissions.
Status of the device or service is continuous and available as long as the system is running. A user-mode driver would have to reset the device into a known quiescent state everytime the program started.
More consistent/accurate timers and reduced event latency.
An example of user-mode versus kernel-mode is the Reliable Datagram Sockets that was added to the Linux kernel in version 2.6.30. Previously RDS was a user-mode protocol based on UDP but enhanced with "acking / windowing / fragmenting / re-ordering, etc". Under heavy loads the timers of the user-mode protocol were not accurate, so additional retransmissions and dropped messages caused stability and performance issues. A switch to a kernel-mode network protocol was intended to improve/solve such issues.
However there are pitfalls (or a responsibility) to kernel mode. Kernel code is responsible for ensuring the integrity and security of the system. RDS was found to introduce a security hole in the kernel.
Why would logging be done from kernel, rather then doing it is userspace?
There could be several reasons, but also for this example it would be likely that the log requestors would be in kernel mode rather than user mode, so this would avoid awkward mode switching.