The sizes of Be2+ and O2- are small and are highly compatible with each other. Due to this, a high amount of lattice energy is released during its formation. The hydration energy, when it is made to dissolve in water, is not enough to overcome the lattice energy. Thus, BeO is barely soluble in water.
Whereas the size of an SO42- is large compared to Be2+ and there is lesser compatibility and lattice energy which can be easily overcome by the hydration energy. Thus, BeSO4 is easily soluble in water.