Spring boot loadbyusername
Some tips:

Tip 1

@Autowired
AccountRepository accountRepository;

@Autowired
BCryptPasswordEncoder bCryptPasswordEncoder;
...


Setter injection is considered as bad practice prefer constructor injection to gain more control and to avoid NullPointerExceptions.
Why field injection is evil

Tip 2

@Id
private String id = UUID.randomUUID().toString();


Encapsulate id generation into some component class eg. IDGenerator.nextId() where IDGenerator is an interface and you would provide some implementation class for that. You'll have more control in testing.

Tip 3

Optional&lt;Account&gt; optionalAccount = accountRepository.findByUsername(s);

if (!optionalAccount.isPresent()) {
    throw new UsernameNotFoundException("Account named " + s + " not found");
}

return new AccountDetails(optionalAccount.get());


Using Optional like that is considered as bad practice. Something like that would be a lot better:

Account account = accountRepository.findByUsername(s).orElseThrow(UsernameNotFoundException::new)
return new AccountDetails(account)


Tip 4

throw new RuntimeException();


You should throw more specific exceptions.

Tip 5 UPDATE

I think that AccountService.remove(AccountDTO accountDTO) is too complex.
I believe in that case would be better to just write own deletion method in repository:

public void remove(AccountDTO accountDTO) {
    Objects.requireNonNull(accountDTO);
    accountRepository.deleteByUsername(accountDTO.getUsername());
}


Tip 6

AccountService and AccountDetailsService could be as one class, these classes have similar responsibilities.

Tip 7


  Then where should we use loadbyusername method?


Spring security needs class which implements this interface when we use some other user data store than in memory.
When some client app try to login / generate token this method 
would be invoked by spring and whether if user exists or not spring
would respond with 400 Bad Request or 200 OK.