I've learned that a stream cipher like ChaCha20 generates a key stream that gets XORed with the plaintext to get the ciphertext... If an attacker knows the plaintext, he could just simply XOR that with the ciphertext to get the corresponding keystream. Is there any security issue with this? I realize that it is because of the XORing operation that this is easily possible. Is there an even better way to encrypt the plaintext using the keystream without using XOR, that would also facilitate message authentication?
First, there's no issue with modern stream cipher constructions - either using an AEAD block cipher mode of operation such as GCM, or the combination of ChaCha20-Poly1305 as Google had experimented and subsequently formalized in the form of Internet RFC documents.
Stream ciphers are basically reduced-capability one-time-pads as one may infer: stream cipher cipher streams only has as many possible values as there are keys, where as one-time-pads are truely random. This is fine since physically buildable computers (including those hypothetical quantum computers) are bounded in capabilities - in both time and space dimensions.
Second, the new trend in the field is to build AEADs from permutations using Duplex construction (I admit these aren't the popular knowledges you might learn from school or might encounter in your TV programs or newspapers).
Indeed, ChaCha20 and Poly1305 are separate primitives that were introduced as "backup"s to AES, etc. Even the original paper proposing Poly1305 introduced it as AES-Poly1305.
Roughly describing the concept:
Recall the SHA3 hash functions are based on 1600-bit Keccak permutation running in Sponge mode - the permutation is partitioned into 2 parts, 1 part is used to absorb data and squeeze out the hash digest, the other part is kept secret as the security capacity.
Duplex is similar, except the data is read as they goes in. Adding in some careful design, you get a AEAD from a single primitive - the permutation.
Examples of these types of cipher include Gimli, Xoodyak, etc. You'd find some more at NIST lightweight cryptography project page.