Ah....a problem I have struggled with myself. I am going to assume that you have a decent grasp of Livecycle and not delve into each aspect like how to open the Script Editor, but if I am wrong just let me know and I can expand on it.
On the field(s) that you wish to restrict spacing, create a Exit event with the following code:
var r = new RegExp("^[a-z,0-9]*$");
var result = r.test(this.rawValue);
if ( result != true )
{
xfa.host.messageBox( "Enter alpha or numerical characters only. Do not enter spaces." );
xfa.host.setFocus( this );
}
What should happen is that this will restrict the field from accepting either null values or blanks and only allow alpha or numberical characters and it should prompt the user. Also it should fix your data validation problem. I did test this out with a sample sheet that has a required field and a email submitt button and with this code it would not allow just spacing. One thing to keep in mind is how you have your fields setup. For example if you have one field for "Name" instead of "First Name" & "Last Name" it will error out. This snippet will not allow spaces anywhere.