Setting on body directly like that is fine.
Using a class like you original approach is more flexible in a way - then the CSS can stay the same but you can experiment with adding bgimage to html element or body element or an element inside body.
If you added no CSS besides the lines you shared then that is great. Just note that if you change your layout or theme that your background might no longer cover the full screen.
Also be sure to test your site on a mobile device. The tall screen and wrapping to fit that has caused issues on my sites around text and images.