There is nothing in the 5e rules (at least that I'm aware of) that either allows or prevents the acquisition of a non-combat non-magical pet.
That means that whether or not you can have a pet is completely and totally up to your DM.
As to whether or not there is a balance issue related to having a pet, I would not be very worried about it. It may occasionally provide a very small benefit (I'd maybe let it provide advantage once a day if I wanted something explicitly mechanical for it), but in general it's not going to be important and is merely a flavor element for a character.
That said, if you did want a mechanical element to a pet, the Find Familiar spell would be a good place to look to get a non-combat effective pet that does have some mechanical utility.
In summary, there's nothing in the rules that allows or prevents this, so consult your DM, but do so knowing that it's probably not going to be a mechanical concern (especially if it's spelled out explicitly that it can't be). If there is a need for more mechanical weight, then find familiar is a good model.
On the more general aspect, I can only speak to 4e, but it had a theme called Animal Master that gave you an animal companion that was basically just a vanity pet with a small mechanical benefit (you could use it to gain combat advantage once per day). It was a minion, so not very combat effective and was mostly a flavor piece with a minor benefit.
It does have some limitations, such as taking an entire hour and significant material resources to cast, and requiring a spell slot each for the Glyph and the stored spell (unless you go with explosive runes). Part of the reason I suspect for Glyph of Warding being as costly as it is comes down to it allowing you to escape most of the normal limits on spellcasting:
- it pre-loads the action needed to cast a spell which can break action economy,
- as you stated it also allows the caster to escape Line of Sight requirements,
- it lets the caster effectively maintain two concentration spells,
- long rests don't reset it the way they do many other things, meaning you can pre-load it more or less infinitely (with enough time and money) leading to hilarity
- and likely more.
There are other spells that you can effectively drop on an area to be activated later, such as Magic Mouth. Both of these spells have a duration of "Until dispelled", and I suspect so will similar spells. The site doesn't let me browse by spell durations, unfortunately, but if you keep an eye out for either that duration or "Permanent", you'll find more of what you're looking for.
The best part is, it almost completely obviates the need for a homebrew system, so you don't really need to worry about balance if you stick to it, and if you need to fudge something you have these as a baseline.
Best Answer
Getting the Demon Spirit Out
The rules don't really specify what happens when a demonic spirit is exorcised, so we're going to be using the assumption that the spirit is still around once it leaves the body. If you rule differently, you won't need the latter half of this answer.
Dispel Evil and Good explicitly mentions ending possession of a creature. This will probably be the easiest way to get the demon out.
What is told about demonic possession from the Monster Manual is that demons can possess creatures when their essence emerges from the container that holds it, which implies the demon was bound to an object. Essence here implies more of a spirit or soul, rather than tangible body. You can read about binding demons and possession in the Monster Manual, page 51, under the headers Bound Demons and Demonic Possession. This also suggests that demons can't normally possess other creatures if they have their own tangible body. There's nothing to suggest their spirit can move from body to body willingly, but there's nothing suggesting they can't possess another creature after their spirit has forcefully been removed from the previous host either.
What this likely means is that exercising the demon will probably result in it attempting to possess another creature.
You have two options:
Sending the Demon Spirit Back to the Abyss
With this option, you're looking to send the demon spirit away. If the DM allows it, the spirit should be able to be targeted by spells. There's no real rules for a spirit, so you'll need to decide if this is possible. If it is you can use a simple spell like Banishment to send the spirit back. Another, more complicated way is to cast True Resurrection on the spirit (you'll need to know his true name) and then fight its new body to send it back. You may also use that as a bargaining chip, to perhaps make a deal with the demon, if that is even possible.
You might also be able to remove the demon by finding an amulet it has put part of its essence into. Destroying the amulet will trap the demon in the Abyss for a year and a day (MM, pg 51, Protected Essence). This would probably end possession and send it back all in one go, depending on how you rule it.
Binding the Spirit to an Object
You also have the option to bind the Demon to an object, which is likely how it came to possess something in the first place.
The Monster Manual suggests that The Book of Vile Darkness, the Black Scrolls of Ahm, and the Demonomicon of Iggwilv are the foremost authorities on this subject. The Book of Vile Darkness is detailed in the Dungeon Master's Guide on page 222, in the Artifacts section. Suffice it to say that binding the demonic essence or sending it back to the Abyss is something you're going to have to use your DM powers for. Keep in mind you'll most likely need an evil character to use the book. The Book of Exalted Deeds is basically the polar opposite of this and might also help, altough it doesn't detail any control over fiends and the like, but it does help you fight them and can even destroy an evil creature that tries to read it (if a demon, this would likely send it back to the Abyss).
Either Way...
It would be smart to cast Protection from Evil and Good on your party and any participants in the exorcism, as it protects you from possession. It can also be used to exorcise the demon from the host, but only if there is a relevant save (there isn't one listed for demonic possession).
I'd also suggest a good reason for the possession. The MM suggests that demons that escape their bindings seek revenge on the one who bound them, which could be the noble or someone close to him, depending on how powerful the demon is. Greater demons are usually smarter than lesser demons - I mean that to say that a greater demon would likely plot and scheme through possession, where a lesser demon would likely just rage around and create chaos.